@Override
public final int hashCode() {
return new HashCodeBuilder().append(this.getId()).toHashCode();
}
@Override
public boolean equals(final Object obj) {
if (obj == null) {
return false;
}
if (obj == this) {
return true;
}
if (obj.getClass() != getClass()) {
return false;
}
final SimplePrincipal rhs = (SimplePrincipal) obj;
return new EqualsBuilder()
.append(this.id, rhs.id)
.isEquals();
}
原创文章,欢迎转载,转载请注明出处!