Exemplo n.º 1
0
 public int hashCode() {
   int result;
   result = rating.hashCode();
   result = 29 * result + (text != null ? text.hashCode() : 0);
   result = 29 * result + created.hashCode();
   return result;
 }
Exemplo n.º 2
0
  public boolean equals(Object o) {
    if (this == o) return true;
    if (!(o instanceof Comment)) return false;

    final Comment comment = (Comment) o;

    if (!(created.getTime() == comment.created.getTime())) return false;
    if (!rating.equals(comment.rating)) return false;
    if (text != null ? !text.equals(comment.text) : comment.text != null) return false;

    return true;
  }