@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 longAndIntegerIdsWithSameValueAreEqualAndHaveSameHashcode() { ObjectIdentity obj = new ObjectIdentityImpl(Object.class, new Long(5)); ObjectIdentity obj2 = new ObjectIdentityImpl(Object.class, Integer.valueOf(5)); assertThat(obj2).isEqualTo(obj); assertThat(obj2.hashCode()).isEqualTo(obj.hashCode()); }
@Test public void equalStringIdsAreEqualAndHaveSameHashcode() throws Exception { ObjectIdentity obj = new ObjectIdentityImpl(Object.class, "1000"); ObjectIdentity obj2 = new ObjectIdentityImpl(Object.class, "1000"); assertThat(obj2).isEqualTo(obj); assertThat(obj2.hashCode()).isEqualTo(obj.hashCode()); }
@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; }