@Test public void testEquals() { assertTrue(getTestObject().equals(getTestObject())); Relationship testObject = getTestObject(); assertTrue(testObject.equals(testObject)); assertFalse(getTestObject().equals(null)); assertFalse(getTestObject().equals("A String")); Relationship differentObject = getTestObject(); differentObject.setCreatedBy("DifferentAuthor"); assertFalse(testObject.equals(differentObject)); differentObject = getTestObject(); differentObject.setMetadataCollectionId("DifferentHomeId"); assertFalse(testObject.equals(differentObject)); differentObject = getTestObject(); differentObject.setCreateTime(new Date()); assertFalse(testObject.equals(differentObject)); differentObject = getTestObject(); differentObject.setProperties(null); assertFalse(testObject.equals(differentObject)); }
@Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } if (!super.equals(objectToCompare)) { return false; } Relationship that = (Relationship) objectToCompare; return Objects.equals(relationshipProperties, that.relationshipProperties) && Objects.equals(getEntityOneProxy(), that.getEntityOneProxy()) && Objects.equals(getEntityTwoProxy(), that.getEntityTwoProxy()); }
Relationship extends InstanceHeader { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } if (!super.equals(objectToCompare)) { return false; } Relationship that = (Relationship) objectToCompare; return Objects.equals(relationshipProperties, that.relationshipProperties) && Objects.equals(getEntityOneProxy(), that.getEntityOneProxy()) && Objects.equals(getEntityTwoProxy(), that.getEntityTwoProxy()); } }
Relationship extends InstanceHeader { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } if (!super.equals(objectToCompare)) { return false; } Relationship that = (Relationship) objectToCompare; return Objects.equals(relationshipProperties, that.relationshipProperties) && Objects.equals(getEntityOneProxy(), that.getEntityOneProxy()) && Objects.equals(getEntityTwoProxy(), that.getEntityTwoProxy()); } Relationship();  Relationship(Relationship templateElement); }
Relationship extends InstanceHeader { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } if (!super.equals(objectToCompare)) { return false; } Relationship that = (Relationship) objectToCompare; return Objects.equals(relationshipProperties, that.relationshipProperties) && Objects.equals(getEntityOneProxy(), that.getEntityOneProxy()) && Objects.equals(getEntityTwoProxy(), that.getEntityTwoProxy()); } Relationship();  Relationship(Relationship templateElement); boolean relatedToEntity(String  entityGUID); String returnLinkedEntity(String  entityGUID); InstanceProperties getProperties(); void setProperties(InstanceProperties  newProperties); EntityProxy getEntityOneProxy(); void setEntityOneProxy(EntityProxy entityOneProxy); EntityProxy getEntityTwoProxy(); void setEntityTwoProxy(EntityProxy entityTwoProxy); @Override String toString(); @Override boolean equals(Object objectToCompare); @Override int hashCode(); }
Relationship extends InstanceHeader { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (objectToCompare == null || getClass() != objectToCompare.getClass()) { return false; } if (!super.equals(objectToCompare)) { return false; } Relationship that = (Relationship) objectToCompare; return Objects.equals(relationshipProperties, that.relationshipProperties) && Objects.equals(getEntityOneProxy(), that.getEntityOneProxy()) && Objects.equals(getEntityTwoProxy(), that.getEntityTwoProxy()); } Relationship();  Relationship(Relationship templateElement); boolean relatedToEntity(String  entityGUID); String returnLinkedEntity(String  entityGUID); InstanceProperties getProperties(); void setProperties(InstanceProperties  newProperties); EntityProxy getEntityOneProxy(); void setEntityOneProxy(EntityProxy entityOneProxy); EntityProxy getEntityTwoProxy(); void setEntityTwoProxy(EntityProxy entityTwoProxy); @Override String toString(); @Override boolean equals(Object objectToCompare); @Override int hashCode();  }