@Override public int compareTo(LinuxId other) { return this==other ? 0 : ComparatorUtils.compare(id, other.id); }
@Override public int compareTo(Gecos other) { return this==other ? 0 : ComparatorUtils.compareIgnoreCaseConsistentWithEquals(value, other.value); }
@Override public int compareTo(AccountingCode other) { return this==other ? 0 : ComparatorUtils.compareIgnoreCaseConsistentWithEquals(accounting, other.accounting); }
/** * @deprecated This method moved to {@link ComparatorUtils#compare(short, short)} */ @Deprecated public static int compare(short s1, short s2) { return ComparatorUtils.compare(s1, s2); }
@Override public int compareTo(DomainLabel other) { return this==other ? 0 : ComparatorUtils.compareIgnoreCaseConsistentWithEquals(label, other.label); }
/** * @deprecated This method moved to {@link ComparatorUtils#compare(int, int)} */ @Deprecated public static int compare(int i1, int i2) { return ComparatorUtils.compare(i1, i2); }
@Override public int compareTo(UnixPath other) { return this==other ? 0 : ComparatorUtils.compareIgnoreCaseConsistentWithEquals(path, other.path); }
/** * @deprecated This method moved to {@link ComparatorUtils#compare(long, long)} */ @Deprecated public static int compare(long l1, long l2) { return ComparatorUtils.compare(l1, l2); }
/** * @deprecated This method moved to {@link ComparatorUtils#compareIgnoreCaseConsistentWithEquals(java.lang.String, java.lang.String)} */ @Deprecated public static int compareIgnoreCaseConsistentWithEquals(String s1, String s2) { return ComparatorUtils.compareIgnoreCaseConsistentWithEquals(s1, s2); }
/** * Ordered by address, prefix. * * @see InetAddress#compareTo(com.aoindustries.net.InetAddress) */ @Override public int compareTo(InetAddressPrefix other) { int diff = address.compareTo(other.address); if(diff != 0) return diff; return ComparatorUtils.compare(prefix, other.prefix); }
/** * Sorts by domain and then by local part. */ @Override public int compareTo(Email other) { if(this==other) return 0; int diff = domain.compareTo(other.domain); if(diff!=0) return diff; return ComparatorUtils.compareIgnoreCaseConsistentWithEquals(localPart, other.localPart); }
/** * Ordered by from, to, protocol. * The fact that is ordered by "from" is used to break loops, this ordering * must not be changed without adjusting other code. */ @Override final public int compareTo(IPortRange other) { // Java 1.8: Use Integer.compare instead int diff = ComparatorUtils.compare(getFrom(), other.getFrom()); if(diff != 0) return diff; diff = ComparatorUtils.compare(getTo(), other.getTo()); if(diff != 0) return diff; return protocol.compareTo(other.protocol); }
/** * TODO: Should not be public once all classes using validator types. */ public static int compareLabels(String labels1, String labels2) { if(labels1==labels2) return 0; // Shortcut for interned while(labels1.length()>0 && labels2.length()>0) { int pos=labels1.lastIndexOf('.'); String section1; if(pos==-1) { section1=labels1; labels1=""; } else { section1=labels1.substring(pos+1); labels1=labels1.substring(0, pos); } pos=labels2.lastIndexOf('.'); String section2; if(pos==-1) { section2=labels2; labels2=""; } else { section2=labels2.substring(pos+1); labels2=labels2.substring(0, pos); } int diff=ComparatorUtils.compareIgnoreCaseConsistentWithEquals(section1, section2); if(diff!=0) return diff; } return ComparatorUtils.compareIgnoreCaseConsistentWithEquals(labels1, labels2); }