@Test public void testEquals() { assertFalse(getTestObject().equals(null)); assertFalse(getTestObject().equals("DummyString")); assertTrue(getTestObject().equals(getTestObject())); Asset sameObject = getTestObject(); assertTrue(sameObject.equals(sameObject)); Asset differentObject = getTestObject(); differentObject.setGUID("Different"); assertFalse(getTestObject().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; } Asset asset = (Asset) objectToCompare; return Objects.equals(getDisplayName(), asset.getDisplayName()) && Objects.equals(getShortDescription(), asset.getShortDescription()) && Objects.equals(getDescription(), asset.getDescription()) && Objects.equals(getOwner(), asset.getOwner()) && getOwnerType() == asset.getOwnerType() && Objects.equals(getZoneMembership(), asset.getZoneMembership()) && Objects.equals(getOrigin(), asset.getOrigin()) && Objects.equals(getLatestChange(), asset.getLatestChange()); }
Asset extends Referenceable { @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; } Asset asset = (Asset) objectToCompare; return Objects.equals(getDisplayName(), asset.getDisplayName()) && Objects.equals(getShortDescription(), asset.getShortDescription()) && Objects.equals(getDescription(), asset.getDescription()) && Objects.equals(getOwner(), asset.getOwner()) && getOwnerType() == asset.getOwnerType() && Objects.equals(getZoneMembership(), asset.getZoneMembership()) && Objects.equals(getOrigin(), asset.getOrigin()) && Objects.equals(getLatestChange(), asset.getLatestChange()); } }
Asset extends Referenceable { @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; } Asset asset = (Asset) objectToCompare; return Objects.equals(getDisplayName(), asset.getDisplayName()) && Objects.equals(getShortDescription(), asset.getShortDescription()) && Objects.equals(getDescription(), asset.getDescription()) && Objects.equals(getOwner(), asset.getOwner()) && getOwnerType() == asset.getOwnerType() && Objects.equals(getZoneMembership(), asset.getZoneMembership()) && Objects.equals(getOrigin(), asset.getOrigin()) && Objects.equals(getLatestChange(), asset.getLatestChange()); } Asset();  Asset(Asset template); }
Asset extends Referenceable { @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; } Asset asset = (Asset) objectToCompare; return Objects.equals(getDisplayName(), asset.getDisplayName()) && Objects.equals(getShortDescription(), asset.getShortDescription()) && Objects.equals(getDescription(), asset.getDescription()) && Objects.equals(getOwner(), asset.getOwner()) && getOwnerType() == asset.getOwnerType() && Objects.equals(getZoneMembership(), asset.getZoneMembership()) && Objects.equals(getOrigin(), asset.getOrigin()) && Objects.equals(getLatestChange(), asset.getLatestChange()); } Asset();  Asset(Asset template); String getDisplayName(); void setDisplayName(String displayName); String getShortDescription(); void setShortDescription(String shortDescription); String getDescription(); void setDescription(String description); String getOwner(); void setOwner(String owner); OwnerType getOwnerType(); void setOwnerType(OwnerType ownerType); List<String> getZoneMembership(); void setZoneMembership(List<String> zoneMembership); Map<String, String> getOrigin(); void setOrigin(Map<String, String> origin); String getLatestChange(); void setLatestChange(String latestChange); @Override String toString(); @Override boolean equals(Object objectToCompare); @Override int hashCode(); }
Asset extends Referenceable { @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; } Asset asset = (Asset) objectToCompare; return Objects.equals(getDisplayName(), asset.getDisplayName()) && Objects.equals(getShortDescription(), asset.getShortDescription()) && Objects.equals(getDescription(), asset.getDescription()) && Objects.equals(getOwner(), asset.getOwner()) && getOwnerType() == asset.getOwnerType() && Objects.equals(getZoneMembership(), asset.getZoneMembership()) && Objects.equals(getOrigin(), asset.getOrigin()) && Objects.equals(getLatestChange(), asset.getLatestChange()); } Asset();  Asset(Asset template); String getDisplayName(); void setDisplayName(String displayName); String getShortDescription(); void setShortDescription(String shortDescription); String getDescription(); void setDescription(String description); String getOwner(); void setOwner(String owner); OwnerType getOwnerType(); void setOwnerType(OwnerType ownerType); List<String> getZoneMembership(); void setZoneMembership(List<String> zoneMembership); Map<String, String> getOrigin(); void setOrigin(Map<String, String> origin); String getLatestChange(); void setLatestChange(String latestChange); @Override String toString(); @Override boolean equals(Object objectToCompare); @Override int hashCode();  }