@Test public void testCompareTo_EqualsComplex() throws Exception { LdapRdn rdn1 = new LdapRdn("cn=john doe+sn=doe"); LdapRdn rdn2 = new LdapRdn("cn=john doe+sn=doe"); int result = rdn1.compareTo(rdn2); assertThat(result).isEqualTo(0); }
public int compareTo(Object obj) { LdapRdn that = (LdapRdn) obj; if(this.components.size() != that.components.size()) { return this.components.size() - that.components.size(); } Set<Map.Entry<String,LdapRdnComponent>> theseEntries = this.components.entrySet(); for (Map.Entry<String, LdapRdnComponent> oneEntry : theseEntries) { LdapRdnComponent thatEntry = that.components.get(oneEntry.getKey()); if(thatEntry == null) { return -1; } int compared = oneEntry.getValue().compareTo(thatEntry); if(compared != 0) { return compared; } } return 0; }
LdapRdn implements Serializable, Comparable { public int compareTo(Object obj) { LdapRdn that = (LdapRdn) obj; if(this.components.size() != that.components.size()) { return this.components.size() - that.components.size(); } Set<Map.Entry<String,LdapRdnComponent>> theseEntries = this.components.entrySet(); for (Map.Entry<String, LdapRdnComponent> oneEntry : theseEntries) { LdapRdnComponent thatEntry = that.components.get(oneEntry.getKey()); if(thatEntry == null) { return -1; } int compared = oneEntry.getValue().compareTo(thatEntry); if(compared != 0) { return compared; } } return 0; } }
LdapRdn implements Serializable, Comparable { public int compareTo(Object obj) { LdapRdn that = (LdapRdn) obj; if(this.components.size() != that.components.size()) { return this.components.size() - that.components.size(); } Set<Map.Entry<String,LdapRdnComponent>> theseEntries = this.components.entrySet(); for (Map.Entry<String, LdapRdnComponent> oneEntry : theseEntries) { LdapRdnComponent thatEntry = that.components.get(oneEntry.getKey()); if(thatEntry == null) { return -1; } int compared = oneEntry.getValue().compareTo(thatEntry); if(compared != 0) { return compared; } } return 0; } LdapRdn();  LdapRdn(String string);  LdapRdn(String key, String value); }
LdapRdn implements Serializable, Comparable { public int compareTo(Object obj) { LdapRdn that = (LdapRdn) obj; if(this.components.size() != that.components.size()) { return this.components.size() - that.components.size(); } Set<Map.Entry<String,LdapRdnComponent>> theseEntries = this.components.entrySet(); for (Map.Entry<String, LdapRdnComponent> oneEntry : theseEntries) { LdapRdnComponent thatEntry = that.components.get(oneEntry.getKey()); if(thatEntry == null) { return -1; } int compared = oneEntry.getValue().compareTo(thatEntry); if(compared != 0) { return compared; } } return 0; } LdapRdn();  LdapRdn(String string);  LdapRdn(String key, String value); void addComponent(LdapRdnComponent rdnComponent); List getComponents(); LdapRdnComponent getComponent(); LdapRdnComponent getComponent(int idx); String getLdapEncoded(); String encodeUrl(); int compareTo(Object obj); boolean equals(Object obj); int hashCode(); String toString(); String getValue(); String getKey(); String getValue(String key); LdapRdn immutableLdapRdn(); }
LdapRdn implements Serializable, Comparable { public int compareTo(Object obj) { LdapRdn that = (LdapRdn) obj; if(this.components.size() != that.components.size()) { return this.components.size() - that.components.size(); } Set<Map.Entry<String,LdapRdnComponent>> theseEntries = this.components.entrySet(); for (Map.Entry<String, LdapRdnComponent> oneEntry : theseEntries) { LdapRdnComponent thatEntry = that.components.get(oneEntry.getKey()); if(thatEntry == null) { return -1; } int compared = oneEntry.getValue().compareTo(thatEntry); if(compared != 0) { return compared; } } return 0; } LdapRdn();  LdapRdn(String string);  LdapRdn(String key, String value); void addComponent(LdapRdnComponent rdnComponent); List getComponents(); LdapRdnComponent getComponent(); LdapRdnComponent getComponent(int idx); String getLdapEncoded(); String encodeUrl(); int compareTo(Object obj); boolean equals(Object obj); int hashCode(); String toString(); String getValue(); String getKey(); String getValue(String key); LdapRdn immutableLdapRdn();  }