diff options
Diffstat (limited to 'src')
-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 |