summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2016-02-22 12:42:03 +0100
committerJonathan Bauer2016-02-22 12:42:03 +0100
commitea7cb8eb1d250988092ebc72fd71dff0f30c7421 (patch)
tree7abc17000accbb31855e810d980760466d33846b
parentMake hashing classes more robust, report complete blocks without hash info as... (diff)
downloadmaster-sync-shared-ea7cb8eb1d250988092ebc72fd71dff0f30c7421.tar.gz
master-sync-shared-ea7cb8eb1d250988092ebc72fd71dff0f30c7421.tar.xz
master-sync-shared-ea7cb8eb1d250988092ebc72fd71dff0f30c7421.zip
added comparator for locations
-rw-r--r--src/main/java/org/openslx/thrifthelper/Comparators.java23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/main/java/org/openslx/thrifthelper/Comparators.java b/src/main/java/org/openslx/thrifthelper/Comparators.java
index 9f068c2..ec42966 100644
--- a/src/main/java/org/openslx/thrifthelper/Comparators.java
+++ b/src/main/java/org/openslx/thrifthelper/Comparators.java
@@ -4,6 +4,7 @@ import java.util.Comparator;
import org.openslx.bwlp.thrift.iface.ImageSummaryRead;
import org.openslx.bwlp.thrift.iface.ImageVersionDetails;
+import org.openslx.bwlp.thrift.iface.Location;
import org.openslx.bwlp.thrift.iface.OperatingSystem;
import org.openslx.bwlp.thrift.iface.Organization;
import org.openslx.bwlp.thrift.iface.UserInfo;
@@ -88,16 +89,16 @@ public class Comparators
}
};
-// public static final Comparator<Location> location = new Comparator<Location>() {
-// @Override
-// public int compare( Location o1, Location o2 )
-// {
-// if ( o1 == null || o1.loca == null )
-// return o2 == null || o2.organizationId == null ? 0 : 1;
-// if ( o2 == null || o2.organizationId == null )
-// return -1;
-// return o1.organizationId.compareTo( o2.organizationId );
-// }
-// };
+ public static final Comparator<Location> location = new Comparator<Location>() {
+ @Override
+ public int compare( Location o1, Location o2 )
+ {
+ if ( o1 == null || o1.locationName == null )
+ return o2 == null || o2.locationName == null ? 0 : 1;
+ if ( o2 == null || o2.locationName == null )
+ return -1;
+ return o1.locationName.compareTo( o2.locationName );
+ }
+ };
}