/** * Retrieves a hash code for this RDN. * * @return The hash code for this RDN. */ @Override() public int hashCode() { return toNormalizedString().hashCode(); }
/** * Retrieves a hash code for this RDN. * * @return The hash code for this RDN. */ @Override() public int hashCode() { return toNormalizedString().hashCode(); }
/** * Retrieves a normalized string representation of this RDN. * * @return A normalized string representation of this RDN. */ public String toNormalizedString() { if (normalizedString == null) { final StringBuilder buffer = new StringBuilder(); toNormalizedString(buffer); normalizedString = buffer.toString(); } return normalizedString; }
/** * Retrieves a normalized string representation of this RDN. * * @return A normalized string representation of this RDN. */ public String toNormalizedString() { if (normalizedString == null) { final StringBuilder buffer = new StringBuilder(); toNormalizedString(buffer); normalizedString = buffer.toString(); } return normalizedString; }
/** * Indicates whether this RDN is equal to the provided object. The given * object will only be considered equal to this RDN if it is also an RDN with * the same set of names and values. * * @param o The object for which to make the determination. * * @return {@code true} if the provided object can be considered equal to * this RDN, or {@code false} if not. */ @Override() public boolean equals(final Object o) { if (o == null) { return false; } if (o == this) { return true; } if (! (o instanceof RDN)) { return false; } final RDN rdn = (RDN) o; return (toNormalizedString().equals(rdn.toNormalizedString())); }
/** * Indicates whether this RDN is equal to the provided object. The given * object will only be considered equal to this RDN if it is also an RDN with * the same set of names and values. * * @param o The object for which to make the determination. * * @return {@code true} if the provided object can be considered equal to * this RDN, or {@code false} if not. */ @Override() public boolean equals(final Object o) { if (o == null) { return false; } if (o == this) { return true; } if (! (o instanceof RDN)) { return false; } final RDN rdn = (RDN) o; return (toNormalizedString().equals(rdn.toNormalizedString())); }
/** * Appends a normalized string representation of this DN to the provided * buffer. * * @param buffer The buffer to which to append the normalized string * representation of this DN. */ public void toNormalizedString(final StringBuilder buffer) { for (int i=0; i < rdns.length; i++) { if (i > 0) { buffer.append(','); } buffer.append(rdns[i].toNormalizedString()); } }
/** * Compares the provided RDN values to determine their relative order in a * sorted list. * * @param rdn1 The first RDN to be compared. It must not be {@code null}. * @param rdn2 The second RDN to be compared. It must not be {@code null}. * * @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. */ public int compare(final RDN rdn1, final RDN rdn2) { ensureNotNull(rdn1, rdn2); return(rdn1.toNormalizedString().compareTo(rdn2.toNormalizedString())); }
/** * Compares the provided RDN values to determine their relative order in a * sorted list. * * @param rdn1 The first RDN to be compared. It must not be {@code null}. * @param rdn2 The second RDN to be compared. It must not be {@code null}. * * @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. */ public int compare(final RDN rdn1, final RDN rdn2) { ensureNotNull(rdn1, rdn2); return(rdn1.toNormalizedString().compareTo(rdn2.toNormalizedString())); }
/** * Appends a normalized string representation of this DN to the provided * buffer. * * @param buffer The buffer to which to append the normalized string * representation of this DN. */ public void toNormalizedString(final StringBuilder buffer) { for (int i=0; i < rdns.length; i++) { if (i > 0) { buffer.append(','); } buffer.append(rdns[i].toNormalizedString()); } }
/** * Retrieves a normalized string representation of the RDN with the provided * string representation. * * @param s The string representation of the RDN to normalize. It must * not be {@code null}. * @param schema The schema to use to generate the normalized string * representation of the RDN. It may be {@code null} if no * schema is available. * * @return The normalized string representation of the RDN with the provided * string representation. * * @throws LDAPException If the provided string cannot be parsed as an RDN. */ public static String normalize(final String s, final Schema schema) throws LDAPException { return new RDN(s, schema).toNormalizedString(); }
/** * Retrieves a normalized string representation of the RDN with the provided * string representation. * * @param s The string representation of the RDN to normalize. It must * not be {@code null}. * @param schema The schema to use to generate the normalized string * representation of the RDN. It may be {@code null} if no * schema is available. * * @return The normalized string representation of the RDN with the provided * string representation. * * @throws LDAPException If the provided string cannot be parsed as an RDN. */ public static String normalize(final String s, final Schema schema) throws LDAPException { return new RDN(s, schema).toNormalizedString(); }
RDN[] containerRDNs = containerDN.getRDNs(); for (RDN rdn : containerRDNs) { String mappedValue = mapRdn(rdn.toNormalizedString()); if(mappedValue != null || !recurseRdnIfNoMapping) { return mappedValue;
final int targetRDNIndex = rdns.length - splitBaseRDNs.length - 1; final byte[] normalizedRDNBytes = StaticUtils.getBytes(rdns[targetRDNIndex].toNormalizedString());
final int targetRDNIndex = rdns.length - getSplitBaseRDNs().length - 1; final String normalizedRDNString = rdns[targetRDNIndex].toNormalizedString();
final int targetRDNIndex = rdns.length - getSplitBaseRDNs().length - 1; final String normalizedRDNString = rdns[targetRDNIndex].toNormalizedString();
final int targetRDNIndex = rdns.length - getSplitBaseRDNs().length - 1; final String normalizedRDNString = rdns[targetRDNIndex].toNormalizedString();