Exemplo n.º 1
0
  @Override
  public boolean equals(Object obj) {
    if (obj == null) return false;
    if (obj == this) return true;
    if (!obj.getClass().isAssignableFrom(getClass())) return false;

    Post otherPost = (Post) obj;

    return new EqualsBuilder()
        .append(this.getTitle(), otherPost.getTitle())
        .append(this.getAuthor(), otherPost.getAuthor())
        .append(this.getCreationDate(), otherPost.getCreationDate())
        .append(this.getState(), otherPost.getState())
        .isEquals();
  }