diff options
author | Simon Rettberg | 2016-01-26 15:16:40 +0100 |
---|---|---|
committer | Simon Rettberg | 2016-01-26 15:16:40 +0100 |
commit | 6b92088fb5530e63fa38cb91799c95dd797087aa (patch) | |
tree | f397f79fa01360432a24687495cb41e315b3fabb | |
parent | Count currently hashing blocks as complete client side (diff) | |
download | master-sync-shared-6b92088fb5530e63fa38cb91799c95dd797087aa.tar.gz master-sync-shared-6b92088fb5530e63fa38cb91799c95dd797087aa.tar.xz master-sync-shared-6b92088fb5530e63fa38cb91799c95dd797087aa.zip |
[thrift] Add UserInfo comparator
-rw-r--r-- | src/main/java/org/openslx/thrifthelper/Comparators.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/org/openslx/thrifthelper/Comparators.java b/src/main/java/org/openslx/thrifthelper/Comparators.java index bffaef8..9f068c2 100644 --- a/src/main/java/org/openslx/thrifthelper/Comparators.java +++ b/src/main/java/org/openslx/thrifthelper/Comparators.java @@ -6,6 +6,7 @@ import org.openslx.bwlp.thrift.iface.ImageSummaryRead; import org.openslx.bwlp.thrift.iface.ImageVersionDetails; import org.openslx.bwlp.thrift.iface.OperatingSystem; import org.openslx.bwlp.thrift.iface.Organization; +import org.openslx.bwlp.thrift.iface.UserInfo; import org.openslx.bwlp.thrift.iface.Virtualizer; /** @@ -74,6 +75,18 @@ public class Comparators return o1.organizationId.compareTo( o2.organizationId ); } }; + + public static final Comparator<UserInfo> user = new Comparator<UserInfo>() { + @Override + public int compare( UserInfo o1, UserInfo o2 ) + { + if ( o1 == null || o1.userId == null ) + return o2 == null || o2.userId == null ? 0 : 1; + if ( o2 == null || o2.userId == null ) + return -1; + return o1.userId.compareTo( o2.userId ); + } + }; // public static final Comparator<Location> location = new Comparator<Location>() { // @Override |