/** * Compares the provided DN to this DN to determine their relative order in * a sorted list. * * @param dn The DN to compare against this DN. It must not be * {@code null}. * * @return A negative integer if this DN should come before the provided DN * in a sorted list, a positive integer if this DN should come after * the provided DN in a sorted list, or zero if the provided DN can * be considered equal to this DN. */ public int compareTo(final DN dn) { return compare(this, dn); }
/** * Compares the provided DN to this DN to determine their relative order in * a sorted list. * * @param dn The DN to compare against this DN. It must not be * {@code null}. * * @return A negative integer if this DN should come before the provided DN * in a sorted list, a positive integer if this DN should come after * the provided DN in a sorted list, or zero if the provided DN can * be considered equal to this DN. */ public int compareTo(final DN dn) { return compare(this, dn); }
/** * Compares the DNs with the provided string representations to determine * their relative order in a sorted list. * * @param s1 The string representation for the first DN to be compared. It * must not be {@code null}. * @param s2 The string representation for the second DN to be compared. It * must not be {@code null}. * * @return A negative integer if the first DN should come before the second * DN in a sorted list, a positive integer if the first DN should * come after the second DN in a sorted list, or zero if the two DN * values can be considered equal. * * @throws LDAPException If either of the provided strings cannot be parsed * as a DN. */ public static int compare(final String s1, final String s2) throws LDAPException { return compare(s1, s2, null); }
/** * Compares the DNs with the provided string representations to determine * their relative order in a sorted list. * * @param s1 The string representation for the first DN to be compared. It * must not be {@code null}. * @param s2 The string representation for the second DN to be compared. It * must not be {@code null}. * * @return A negative integer if the first DN should come before the second * DN in a sorted list, a positive integer if the first DN should * come after the second DN in a sorted list, or zero if the two DN * values can be considered equal. * * @throws LDAPException If either of the provided strings cannot be parsed * as a DN. */ public static int compare(final String s1, final String s2) throws LDAPException { return compare(s1, s2, null); }