diff options
author | Jonathan Bauer | 2016-09-02 18:35:29 +0200 |
---|---|---|
committer | Jonathan Bauer | 2016-09-02 18:35:29 +0200 |
commit | a44cda2cacde831d82975c63933c2c83c13a1166 (patch) | |
tree | a0e69d2b0452a6510aaf3bcf6b842eb976716db5 | |
parent | Don't use system's line separator but linefeed (diff) | |
download | master-sync-shared-a44cda2cacde831d82975c63933c2c83c13a1166.tar.gz master-sync-shared-a44cda2cacde831d82975c63933c2c83c13a1166.tar.xz master-sync-shared-a44cda2cacde831d82975c63933c2c83c13a1166.zip |
added new comparator for sorting OS by name
-rw-r--r-- | src/main/java/org/openslx/thrifthelper/Comparators.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/org/openslx/thrifthelper/Comparators.java b/src/main/java/org/openslx/thrifthelper/Comparators.java index ec42966..fa16eb4 100644 --- a/src/main/java/org/openslx/thrifthelper/Comparators.java +++ b/src/main/java/org/openslx/thrifthelper/Comparators.java @@ -53,6 +53,18 @@ public class Comparators } }; + public static final Comparator<OperatingSystem> operatingSystemByName = new Comparator<OperatingSystem>() { + @Override + public int compare( OperatingSystem o1, OperatingSystem o2 ) + { + if ( o1 == null ) + return o2 == null ? 0 : 1; + if ( o2 == null ) + return -1; + return o1.osName.compareTo(o2.osName); + } + }; + public static final Comparator<Virtualizer> virtualizer = new Comparator<Virtualizer>() { @Override public int compare( Virtualizer o1, Virtualizer o2 ) |