@Test public void testEquals() { ElementType elementType = new ElementType(); Asset assetBean = new Asset(); elementType.setElementTypeName("TestTypeName"); assetBean.setQualifiedName("TestAssetName"); assetBean.setType(elementType); AssetDescriptor parentAsset = new AssetSummary(assetBean); Map<String, String> propertyMap = new HashMap<>(); AssetPropertyBase assetPropertyBase = new AdditionalProperties(parentAsset, propertyMap); AdditionalProperties additionalProperties = new AdditionalProperties(parentAsset, propertyMap); assertFalse(assetPropertyBase.equals("String Value")); assertTrue(assetPropertyBase.equals(assetPropertyBase)); assertTrue(assetPropertyBase.equals(additionalProperties)); assertTrue(additionalProperties.equals(assetPropertyBase)); ElementType differentElementType = new ElementType(); Asset differentAssetBean = new Asset(); differentElementType.setElementTypeName("DifferentTypeName"); differentAssetBean.setQualifiedName("TestAssetName"); differentAssetBean.setType(differentElementType); AssetDescriptor differentParentAsset = new AssetSummary(differentAssetBean); assertFalse(additionalProperties.equals(new AdditionalProperties(differentParentAsset, propertyMap))); }
@Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof AdditionalProperties)) { return false; } if (!super.equals(objectToCompare)) { return false; } AdditionalProperties that = (AdditionalProperties) objectToCompare; return Objects.equals(additionalProperties, that.additionalProperties); }
AdditionalProperties extends AssetPropertyBase { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof AdditionalProperties)) { return false; } if (!super.equals(objectToCompare)) { return false; } AdditionalProperties that = (AdditionalProperties) objectToCompare; return Objects.equals(additionalProperties, that.additionalProperties); } }
AdditionalProperties extends AssetPropertyBase { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof AdditionalProperties)) { return false; } if (!super.equals(objectToCompare)) { return false; } AdditionalProperties that = (AdditionalProperties) objectToCompare; return Objects.equals(additionalProperties, that.additionalProperties); } AdditionalProperties(Map<String, String>  additionalProperties);  AdditionalProperties(AssetDescriptor     parentAsset,
                                Map<String, String> additionalProperties);  AdditionalProperties(AssetDescriptor   parentAsset, AdditionalProperties templateProperties); }
AdditionalProperties extends AssetPropertyBase { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof AdditionalProperties)) { return false; } if (!super.equals(objectToCompare)) { return false; } AdditionalProperties that = (AdditionalProperties) objectToCompare; return Objects.equals(additionalProperties, that.additionalProperties); } AdditionalProperties(Map<String, String>  additionalProperties);  AdditionalProperties(AssetDescriptor     parentAsset,
                                Map<String, String> additionalProperties);  AdditionalProperties(AssetDescriptor   parentAsset, AdditionalProperties templateProperties); Iterator<String> getPropertyNames(); String getProperty(String name); @Override boolean equals(Object objectToCompare); @Override String toString(); }
AdditionalProperties extends AssetPropertyBase { @Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof AdditionalProperties)) { return false; } if (!super.equals(objectToCompare)) { return false; } AdditionalProperties that = (AdditionalProperties) objectToCompare; return Objects.equals(additionalProperties, that.additionalProperties); } AdditionalProperties(Map<String, String>  additionalProperties);  AdditionalProperties(AssetDescriptor     parentAsset,
                                Map<String, String> additionalProperties);  AdditionalProperties(AssetDescriptor   parentAsset, AdditionalProperties templateProperties); Iterator<String> getPropertyNames(); String getProperty(String name); @Override boolean equals(Object objectToCompare); @Override String toString();  }