Exemple #1
0
  @Override
  public boolean equals(Object other) {
    if (this == other) {
      return true;
    }

    if (!(other instanceof EntityBase)) {
      return false;
    }

    EntityBase castOther = (EntityBase) other;
    return new EqualsBuilder()
        .append(this.getClass(), castOther.getClass())
        .append(this.getId(), castOther.getId())
        .isEquals();
  }
Exemple #2
0
 @Override
 public int compareTo(EntityBase other) {
   return new CompareToBuilder().append(this.getId(), other.getId()).toComparison();
 }