/** * Compares the specified Object with this Rdn for equality. Returns true if the given object is * also a Rdn and the two Rdns represent the same attribute type and value mappings. The order of * components in multi-valued Rdns (such as "ou=Sales+cn=Bob") is not significant. * * <p>Type and value equality matching is done as below: * * <ul> * <li>The types are compared for equality with their case ignored. * <li>String values with different but equivalent usage of quoting, escaping, or * UTF8-hex-encoding are considered equal. The case of the values is ignored during the * comparison. * </ul> * * <p>If obj is null or not an instance of Rdn, false is returned. * * <p> * * @param obj object to be compared for equality with this Rdn. * @return true if the specified object is equal to this Rdn. * @see #hashCode() */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof Rdn)) { return false; } Rdn that = (Rdn) obj; if (entries.size() != that.size()) { return false; } for (int i = 0; i < entries.size(); i++) { if (!entries.get(i).equals(that.entries.get(i))) { return false; } } return true; }