/** * Returns <code>true</code> if the given object is semantically equal to the * given object, <code>false</code> otherwise. * <p> * It is assumed that a descriptor with its key is unique. Therefore two * definitions are equal, if their descriptor keys are equal, they share the * same value and source location of the value. * </p> * * @param object object the instance to compare to. * @return <code>true</code> if the given object is semantically equal to the * given object, <code>false</code> otherwise. */ @Override public boolean equals(final Object object) { if (this == object) { return true; } else if (object == null || getClass() != object.getClass()) { return false; } final PropertyDefinition other = (PropertyDefinition) object; return (descriptor.getKey().equals(other.descriptor.getKey()) && ObjectUtils.equals(property.getValue(), other.property.getValue()) && ObjectUtils.equals( property.getSource(), other.property.getSource())); }