final int compValue = dn1.rdns[pos1].compareTo(dn2.rdns[pos2]); if (compValue != 0)
final int compValue = dn1.rdns[pos1].compareTo(dn2.rdns[pos2]); if (compValue != 0)
/** * Compares the RDN values with the provided string representations to * determine their relative order in a sorted list. * * @param s1 The string representation of the first RDN to be compared. * It must not be {@code null}. * @param s2 The string representation of the second RDN to be compared. * It must not be {@code null}. * @param schema The schema to use to generate the normalized string * representations of the RDNs. It may be {@code null} if no * schema is available. * * @return A negative integer if the first RDN should come before the second * RDN in a sorted list, a positive integer if the first RDN should * come after the second RDN in a sorted list, or zero if the two RDN * values can be considered equal. * * @throws LDAPException If either of the provided strings cannot be parsed * as an RDN. */ public static int compare(final String s1, final String s2, final Schema schema) throws LDAPException { return new RDN(s1, schema).compareTo(new RDN(s2, schema)); } }
/** * Compares the RDN values with the provided string representations to * determine their relative order in a sorted list. * * @param s1 The string representation of the first RDN to be compared. * It must not be {@code null}. * @param s2 The string representation of the second RDN to be compared. * It must not be {@code null}. * @param schema The schema to use to generate the normalized string * representations of the RDNs. It may be {@code null} if no * schema is available. * * @return A negative integer if the first RDN should come before the second * RDN in a sorted list, a positive integer if the first RDN should * come after the second RDN in a sorted list, or zero if the two RDN * values can be considered equal. * * @throws LDAPException If either of the provided strings cannot be parsed * as an RDN. */ public static int compare(final String s1, final String s2, final Schema schema) throws LDAPException { return new RDN(s1, schema).compareTo(new RDN(s2, schema)); } }