You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/07/05 05:05:02 UTC
[jira] [Commented] (GROOVY-8218) Allow to specify reverse order for
@Sortable
[ https://issues.apache.org/jira/browse/GROOVY-8218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16074255#comment-16074255 ]
ASF GitHub Bot commented on GROOVY-8218:
----------------------------------------
Github user jwagenleitner commented on a diff in the pull request:
https://github.com/apache/groovy/pull/558#discussion_r125553175
--- Diff: src/main/org/codehaus/groovy/transform/SortableASTTransformation.java ---
@@ -112,7 +113,7 @@ private static void implementComparable(ClassNode classNode) {
}
}
- private static Statement createCompareToMethodBody(List<PropertyNode> properties) {
+ private static Statement createCompareToMethodBody(List<PropertyNode> properties, Boolean reversed) {
--- End diff --
`boolean` as the parameter type would be consistent with the other methods below.
> Allow to specify reverse order for @Sortable
> --------------------------------------------
>
> Key: GROOVY-8218
> URL: https://issues.apache.org/jira/browse/GROOVY-8218
> Project: Groovy
> Issue Type: Improvement
> Reporter: Paul-Julien Vauthier
> Priority: Minor
>
> When using the Sortable annotation it is not possible to use reverse order.
> For a leaderboard, you may want to sort its entries by points.
> {code}
> @Sortable(reversed = true)
> class LeaderBoardEntry {
> int points
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)