@Test public void testEquals() { assertEqualsContract( new RoleGrantedAuthority( new GrantedAuthorityTarget("project", Type.PROJECT), "admin"), new RoleGrantedAuthority( new GrantedAuthorityTarget("project", Type.PROJECT), "admin"), new RoleGrantedAuthority( new GrantedAuthorityTarget("project", Type.PROJECT), "admin"), new RoleGrantedAuthority( new GrantedAuthorityTarget("project2", Type.PROJECT), "admin")); }
@Override public boolean equals(Object o) { if (o == this) { return true; } else if ((o != null) && o.getClass().equals(getClass())) { RoleGrantedAuthority other = (RoleGrantedAuthority) o; return new EqualsBuilder() .append(other.target, target) .append(other.roleName, roleName) .isEquals(); } return false; }
RoleGrantedAuthority implements GrantedAuthority { @Override public boolean equals(Object o) { if (o == this) { return true; } else if ((o != null) && o.getClass().equals(getClass())) { RoleGrantedAuthority other = (RoleGrantedAuthority) o; return new EqualsBuilder() .append(other.target, target) .append(other.roleName, roleName) .isEquals(); } return false; } }
RoleGrantedAuthority implements GrantedAuthority { @Override public boolean equals(Object o) { if (o == this) { return true; } else if ((o != null) && o.getClass().equals(getClass())) { RoleGrantedAuthority other = (RoleGrantedAuthority) o; return new EqualsBuilder() .append(other.target, target) .append(other.roleName, roleName) .isEquals(); } return false; } RoleGrantedAuthority(GrantedAuthorityTarget target, String roleName); }
RoleGrantedAuthority implements GrantedAuthority { @Override public boolean equals(Object o) { if (o == this) { return true; } else if ((o != null) && o.getClass().equals(getClass())) { RoleGrantedAuthority other = (RoleGrantedAuthority) o; return new EqualsBuilder() .append(other.target, target) .append(other.roleName, roleName) .isEquals(); } return false; } RoleGrantedAuthority(GrantedAuthorityTarget target, String roleName); @Override String getAuthority(); @Override boolean equals(Object o); @Override int hashCode(); }
RoleGrantedAuthority implements GrantedAuthority { @Override public boolean equals(Object o) { if (o == this) { return true; } else if ((o != null) && o.getClass().equals(getClass())) { RoleGrantedAuthority other = (RoleGrantedAuthority) o; return new EqualsBuilder() .append(other.target, target) .append(other.roleName, roleName) .isEquals(); } return false; } RoleGrantedAuthority(GrantedAuthorityTarget target, String roleName); @Override String getAuthority(); @Override boolean equals(Object o); @Override int hashCode();  }