@Test public void testEquals() { Authentication auth1 = new ComponentAuthentication( "key", new Component() ); Authentication auth2 = new ComponentAuthentication( "key", new Component() ); Authentication auth3 = new ComponentAuthentication( "key", new Object() ); assertEquals( auth1, auth2 ); assertFalse( auth1.equals( auth3 ) ); assertFalse( auth1.equals( null ) ); }
@Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } ComponentAuthentication that = (ComponentAuthentication) obj; return key.equals( that.key ) && eqClass( value, that.value ); }
ComponentAuthentication implements Authentication { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } ComponentAuthentication that = (ComponentAuthentication) obj; return key.equals( that.key ) && eqClass( value, that.value ); } }
ComponentAuthentication implements Authentication { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } ComponentAuthentication that = (ComponentAuthentication) obj; return key.equals( that.key ) && eqClass( value, that.value ); } ComponentAuthentication( String key, Object value ); }
ComponentAuthentication implements Authentication { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } ComponentAuthentication that = (ComponentAuthentication) obj; return key.equals( that.key ) && eqClass( value, that.value ); } ComponentAuthentication( String key, Object value ); void fill( AuthenticationContext context, String key, Map<String, String> data ); void digest( AuthenticationDigest digest ); @Override boolean equals( Object obj ); @Override int hashCode(); @Override String toString(); }
ComponentAuthentication implements Authentication { @Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } ComponentAuthentication that = (ComponentAuthentication) obj; return key.equals( that.key ) && eqClass( value, that.value ); } ComponentAuthentication( String key, Object value ); void fill( AuthenticationContext context, String key, Map<String, String> data ); void digest( AuthenticationDigest digest ); @Override boolean equals( Object obj ); @Override int hashCode(); @Override String toString();  }