@Override public boolean equals(Object obj) { /* * Any major changes to this method such as adding a field check, requires changes in the * hashCode method. According to the Java Object Specification, "If two objects are equal * according to the equals(Object) method, then calling the hashCode method on each of the * two objects must produce the same integer result." */ if (!(obj instanceof ContentType)) { return false; } ContentType newObject = (ContentType) obj; if (this.getName() == null) { if (newObject.getName() != null) { return false; } } else if (!this.getName().equals(newObject.getName())) { return false; } if (this.getVersion() == null) { if (newObject.getVersion() != null) { return false; } } else if (!this.getVersion().equals(newObject.getVersion())) { return false; } if (this.getNamespace() == null) { if (newObject.getNamespace() != null) { return false; } } else if (!this.getNamespace().equals(newObject.getNamespace())) { return false; } return true; }