@Test public void testEqualsAtav2TypeSuperior() throws LdapException { Ava atav1 = new Ava( schemaManager, "a", "b" ); Ava atav2 = new Ava( schemaManager, "b", "b" ); assertFalse( atav1.equals( atav2 ) ); }
@Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( !( obj instanceof Ava ) ) { return false; } Ava instance = ( Ava ) obj; if ( attributeType == null ) { if ( normType == null ) { if ( instance.normType != null ) { return false; } } else { if ( !normType.equals( instance.normType ) ) { return false; } } } else { if ( instance.getAttributeType() == null ) { if ( ( schemaManager != null ) && !attributeType.equals( schemaManager.getAttributeType( instance.getType() ) ) ) { return false; } } else if ( !attributeType.equals( instance.getAttributeType() ) ) { return false; } } if ( ( value == null ) || value.isNull() ) { return ( instance.value == null ) || instance.value.isNull(); } else { if ( schemaManager != null ) { if ( ( value.getString() != null ) && value.getString().equals( instance.value.getString() ) ) { return true; } if ( attributeType == null ) { attributeType = schemaManager.getAttributeType( normType ); } MatchingRule equalityMatchingRule = attributeType.getEquality(); if ( equalityMatchingRule != null ) { Normalizer normalizer = equalityMatchingRule.getNormalizer(); try { return equalityMatchingRule.getLdapComparator().compare( normalizer.normalize( value.getString() ), instance.value.getString() ) == 0; } catch ( LdapException le ) { LOG.error( I18n.err( I18n.ERR_13620_CANNOT_NORMALIZE_VALUE ), le.getMessage() ); return false; } } else { if ( !value.isHumanReadable() ) { return Arrays.equals( value.getBytes(), instance.value.getBytes() ); } else { return value.getString().equals( instance.value.getString() ); } } } else { return value.equals( instance.value ); } } }
Ava implements Externalizable, Cloneable, Comparable<Ava> { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( !( obj instanceof Ava ) ) { return false; } Ava instance = ( Ava ) obj; if ( attributeType == null ) { if ( normType == null ) { if ( instance.normType != null ) { return false; } } else { if ( !normType.equals( instance.normType ) ) { return false; } } } else { if ( instance.getAttributeType() == null ) { if ( ( schemaManager != null ) && !attributeType.equals( schemaManager.getAttributeType( instance.getType() ) ) ) { return false; } } else if ( !attributeType.equals( instance.getAttributeType() ) ) { return false; } } if ( ( value == null ) || value.isNull() ) { return ( instance.value == null ) || instance.value.isNull(); } else { if ( schemaManager != null ) { if ( ( value.getString() != null ) && value.getString().equals( instance.value.getString() ) ) { return true; } if ( attributeType == null ) { attributeType = schemaManager.getAttributeType( normType ); } MatchingRule equalityMatchingRule = attributeType.getEquality(); if ( equalityMatchingRule != null ) { Normalizer normalizer = equalityMatchingRule.getNormalizer(); try { return equalityMatchingRule.getLdapComparator().compare( normalizer.normalize( value.getString() ), instance.value.getString() ) == 0; } catch ( LdapException le ) { LOG.error( I18n.err( I18n.ERR_13620_CANNOT_NORMALIZE_VALUE ), le.getMessage() ); return false; } } else { if ( !value.isHumanReadable() ) { return Arrays.equals( value.getBytes(), instance.value.getBytes() ); } else { return value.getString().equals( instance.value.getString() ); } } } else { return value.equals( instance.value ); } } } }
Ava implements Externalizable, Cloneable, Comparable<Ava> { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( !( obj instanceof Ava ) ) { return false; } Ava instance = ( Ava ) obj; if ( attributeType == null ) { if ( normType == null ) { if ( instance.normType != null ) { return false; } } else { if ( !normType.equals( instance.normType ) ) { return false; } } } else { if ( instance.getAttributeType() == null ) { if ( ( schemaManager != null ) && !attributeType.equals( schemaManager.getAttributeType( instance.getType() ) ) ) { return false; } } else if ( !attributeType.equals( instance.getAttributeType() ) ) { return false; } } if ( ( value == null ) || value.isNull() ) { return ( instance.value == null ) || instance.value.isNull(); } else { if ( schemaManager != null ) { if ( ( value.getString() != null ) && value.getString().equals( instance.value.getString() ) ) { return true; } if ( attributeType == null ) { attributeType = schemaManager.getAttributeType( normType ); } MatchingRule equalityMatchingRule = attributeType.getEquality(); if ( equalityMatchingRule != null ) { Normalizer normalizer = equalityMatchingRule.getNormalizer(); try { return equalityMatchingRule.getLdapComparator().compare( normalizer.normalize( value.getString() ), instance.value.getString() ) == 0; } catch ( LdapException le ) { LOG.error( I18n.err( I18n.ERR_13620_CANNOT_NORMALIZE_VALUE ), le.getMessage() ); return false; } } else { if ( !value.isHumanReadable() ) { return Arrays.equals( value.getBytes(), instance.value.getBytes() ); } else { return value.getString().equals( instance.value.getString() ); } } } else { return value.equals( instance.value ); } } } Ava();  Ava( SchemaManager schemaManager );  Ava( SchemaManager schemaManager, Ava ava );  Ava( String upType, byte[] upValue );  Ava( SchemaManager schemaManager, String upType, byte[] upValue );  Ava( SchemaManager schemaManager, String upType, String upName, byte[] upValue );  Ava( String upType, String upValue );  Ava( SchemaManager schemaManager, String upType, String upValue );  Ava( SchemaManager schemaManager, String upType, String upName, String upValue );   Ava( String upType, String normType, Value value, String upName );   Ava( AttributeType attributeType, String upType, String normType, Value value, String upName );   Ava( SchemaManager schemaManager, String upType, String normType, Value value ); }
Ava implements Externalizable, Cloneable, Comparable<Ava> { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( !( obj instanceof Ava ) ) { return false; } Ava instance = ( Ava ) obj; if ( attributeType == null ) { if ( normType == null ) { if ( instance.normType != null ) { return false; } } else { if ( !normType.equals( instance.normType ) ) { return false; } } } else { if ( instance.getAttributeType() == null ) { if ( ( schemaManager != null ) && !attributeType.equals( schemaManager.getAttributeType( instance.getType() ) ) ) { return false; } } else if ( !attributeType.equals( instance.getAttributeType() ) ) { return false; } } if ( ( value == null ) || value.isNull() ) { return ( instance.value == null ) || instance.value.isNull(); } else { if ( schemaManager != null ) { if ( ( value.getString() != null ) && value.getString().equals( instance.value.getString() ) ) { return true; } if ( attributeType == null ) { attributeType = schemaManager.getAttributeType( normType ); } MatchingRule equalityMatchingRule = attributeType.getEquality(); if ( equalityMatchingRule != null ) { Normalizer normalizer = equalityMatchingRule.getNormalizer(); try { return equalityMatchingRule.getLdapComparator().compare( normalizer.normalize( value.getString() ), instance.value.getString() ) == 0; } catch ( LdapException le ) { LOG.error( I18n.err( I18n.ERR_13620_CANNOT_NORMALIZE_VALUE ), le.getMessage() ); return false; } } else { if ( !value.isHumanReadable() ) { return Arrays.equals( value.getBytes(), instance.value.getBytes() ); } else { return value.getString().equals( instance.value.getString() ); } } } else { return value.equals( instance.value ); } } } Ava();  Ava( SchemaManager schemaManager );  Ava( SchemaManager schemaManager, Ava ava );  Ava( String upType, byte[] upValue );  Ava( SchemaManager schemaManager, String upType, byte[] upValue );  Ava( SchemaManager schemaManager, String upType, String upName, byte[] upValue );  Ava( String upType, String upValue );  Ava( SchemaManager schemaManager, String upType, String upValue );  Ava( SchemaManager schemaManager, String upType, String upName, String upValue );   Ava( String upType, String normType, Value value, String upName );   Ava( AttributeType attributeType, String upType, String normType, Value value, String upName );   Ava( SchemaManager schemaManager, String upType, String normType, Value value ); String getNormType(); String getType(); Value getValue(); String getName(); String getEscaped(); @Override Ava clone(); @Override int hashCode(); @Override boolean equals( Object obj ); int serialize( byte[] buffer, int pos ); int deserialize( byte[] buffer, int pos ); @Override void writeExternal( ObjectOutput out ); @Override void readExternal( ObjectInput in ); boolean isSchemaAware(); AttributeType getAttributeType(); @Override int compareTo( Ava that ); @Override String toString(); }
Ava implements Externalizable, Cloneable, Comparable<Ava> { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( !( obj instanceof Ava ) ) { return false; } Ava instance = ( Ava ) obj; if ( attributeType == null ) { if ( normType == null ) { if ( instance.normType != null ) { return false; } } else { if ( !normType.equals( instance.normType ) ) { return false; } } } else { if ( instance.getAttributeType() == null ) { if ( ( schemaManager != null ) && !attributeType.equals( schemaManager.getAttributeType( instance.getType() ) ) ) { return false; } } else if ( !attributeType.equals( instance.getAttributeType() ) ) { return false; } } if ( ( value == null ) || value.isNull() ) { return ( instance.value == null ) || instance.value.isNull(); } else { if ( schemaManager != null ) { if ( ( value.getString() != null ) && value.getString().equals( instance.value.getString() ) ) { return true; } if ( attributeType == null ) { attributeType = schemaManager.getAttributeType( normType ); } MatchingRule equalityMatchingRule = attributeType.getEquality(); if ( equalityMatchingRule != null ) { Normalizer normalizer = equalityMatchingRule.getNormalizer(); try { return equalityMatchingRule.getLdapComparator().compare( normalizer.normalize( value.getString() ), instance.value.getString() ) == 0; } catch ( LdapException le ) { LOG.error( I18n.err( I18n.ERR_13620_CANNOT_NORMALIZE_VALUE ), le.getMessage() ); return false; } } else { if ( !value.isHumanReadable() ) { return Arrays.equals( value.getBytes(), instance.value.getBytes() ); } else { return value.getString().equals( instance.value.getString() ); } } } else { return value.equals( instance.value ); } } } Ava();  Ava( SchemaManager schemaManager );  Ava( SchemaManager schemaManager, Ava ava );  Ava( String upType, byte[] upValue );  Ava( SchemaManager schemaManager, String upType, byte[] upValue );  Ava( SchemaManager schemaManager, String upType, String upName, byte[] upValue );  Ava( String upType, String upValue );  Ava( SchemaManager schemaManager, String upType, String upValue );  Ava( SchemaManager schemaManager, String upType, String upName, String upValue );   Ava( String upType, String normType, Value value, String upName );   Ava( AttributeType attributeType, String upType, String normType, Value value, String upName );   Ava( SchemaManager schemaManager, String upType, String normType, Value value ); String getNormType(); String getType(); Value getValue(); String getName(); String getEscaped(); @Override Ava clone(); @Override int hashCode(); @Override boolean equals( Object obj ); int serialize( byte[] buffer, int pos ); int deserialize( byte[] buffer, int pos ); @Override void writeExternal( ObjectOutput out ); @Override void readExternal( ObjectInput in ); boolean isSchemaAware(); AttributeType getAttributeType(); @Override int compareTo( Ava that ); @Override String toString();  }