@Override public int hashCode() { int result = this.acl.hashCode(); result = 31 * result + this.permission.hashCode(); result = 31 * result + (this.id != null ? this.id.hashCode() : 0); result = 31 * result + this.sid.hashCode(); result = 31 * result + (this.auditFailure ? 1 : 0); result = 31 * result + (this.auditSuccess ? 1 : 0); result = 31 * result + (this.granting ? 1 : 0); return result; }
@Override public int hashCode() { int result = this.parentAcl != null ? this.parentAcl.hashCode() : 0; result = 31 * result + this.aclAuthorizationStrategy.hashCode(); result = 31 * result + (this.permissionGrantingStrategy != null ? this.permissionGrantingStrategy.hashCode() : 0); result = 31 * result + (this.aces != null ? this.aces.hashCode() : 0); result = 31 * result + this.objectIdentity.hashCode(); result = 31 * result + this.id.hashCode(); result = 31 * result + (this.owner != null ? this.owner.hashCode() : 0); result = 31 * result + (this.loadedSids != null ? this.loadedSids.hashCode() : 0); result = 31 * result + (this.entriesInheriting ? 1 : 0); return result; }
@Test public void testGrantedAuthoritySidHashCode() throws Exception { GrantedAuthority ga = new SimpleGrantedAuthority("ROLE_TEST"); Sid gaSid = new GrantedAuthoritySid(ga); assertThat(gaSid.hashCode()).isEqualTo("ROLE_TEST".hashCode()); assertThat(gaSid.hashCode()).isEqualTo( new GrantedAuthoritySid("ROLE_TEST").hashCode()); assertThat(gaSid.hashCode()).isNotEqualTo( new GrantedAuthoritySid("ROLE_TEST_2").hashCode()); assertThat(gaSid.hashCode()).isNotEqualTo(new GrantedAuthoritySid( new SimpleGrantedAuthority("ROLE_TEST_2")).hashCode()); }
@Test public void testPrincipalSidHashCode() throws Exception { Authentication authentication = new TestingAuthenticationToken("johndoe", "password"); Sid principalSid = new PrincipalSid(authentication); assertThat(principalSid.hashCode()).isEqualTo("johndoe".hashCode()); assertThat(principalSid.hashCode()).isEqualTo( new PrincipalSid("johndoe").hashCode()); assertThat(principalSid.hashCode()).isNotEqualTo( new PrincipalSid("scott").hashCode()); assertThat(principalSid.hashCode()).isNotEqualTo(new PrincipalSid( new TestingAuthenticationToken("scott", "password")).hashCode()); }
@Override public int hashCode() { int result = id != null ? id.hashCode() : 0; result = 31 * result + (permission != null ? permission.hashCode() : 0); result = 31 * result + (sid != null ? sid.hashCode() : 0); result = 31 * result + (granting ? 1 : 0); result = 31 * result + (auditFailure ? 1 : 0); result = 31 * result + (auditSuccess ? 1 : 0); return result; }
@Override public int hashCode() { int result = this.acl.hashCode(); result = 31 * result + this.permission.hashCode(); result = 31 * result + (this.id != null ? this.id.hashCode() : 0); result = 31 * result + this.sid.hashCode(); result = 31 * result + (this.auditFailure ? 1 : 0); result = 31 * result + (this.auditSuccess ? 1 : 0); result = 31 * result + (this.granting ? 1 : 0); return result; }
@Override public int hashCode() { int result = parentAcl != null ? parentAcl.hashCode() : 0; result = 31 * result + (aces != null ? aces.hashCode() : 0); result = 31 * result + (objectIdentity != null ? objectIdentity.hashCode() : 0); result = 31 * result + (id != null ? id.hashCode() : 0); result = 31 * result + (owner != null ? owner.hashCode() : 0); result = 31 * result + (loadedSids != null ? loadedSids.hashCode() : 0); result = 31 * result + (entriesInheriting ? 1 : 0); return result; }
@Override public int hashCode() { int result = entries != null ? entries.hashCode() : 0; result = 31 * result + (objectIdentity != null ? objectIdentity.hashCode() : 0); result = 31 * result + (owner != null ? owner.hashCode() : 0); result = 31 * result + (parentAclData != null ? parentAclData.hashCode() : 0); result = 31 * result + (entriesInheriting ? 1 : 0); return result; }
@Override public int hashCode() { int result = this.parentAcl != null ? this.parentAcl.hashCode() : 0; result = 31 * result + this.aclAuthorizationStrategy.hashCode(); result = 31 * result + (this.permissionGrantingStrategy != null ? this.permissionGrantingStrategy.hashCode() : 0); result = 31 * result + (this.aces != null ? this.aces.hashCode() : 0); result = 31 * result + this.objectIdentity.hashCode(); result = 31 * result + this.id.hashCode(); result = 31 * result + (this.owner != null ? this.owner.hashCode() : 0); result = 31 * result + (this.loadedSids != null ? this.loadedSids.hashCode() : 0); result = 31 * result + (this.entriesInheriting ? 1 : 0); return result; }