@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();
}

   

原创文章,欢迎转载,转载请注明出处!

相关文章:

  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2021-11-27
  • 2021-06-11
猜你喜欢
  • 2021-12-31
  • 2021-10-02
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案