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

    if (obj instanceof Item == false) return false;
    Item other = (Item) obj;

    if (other.getName() == null ^ this.getName() == null) return false;
    if (other.getName() != null && other.getName().equals(this.getName()) == false) return false;
    if (other.getAlternateNameEncoding() == null ^ this.getAlternateNameEncoding() == null)
      return false;
    if (other.getAlternateNameEncoding() != null
        && other.getAlternateNameEncoding().equals(this.getAlternateNameEncoding()) == false)
      return false;
    if (other.getAttributes() == null ^ this.getAttributes() == null) return false;
    if (other.getAttributes() != null
        && other.getAttributes().equals(this.getAttributes()) == false) return false;
    return true;
  }