Class Differences
java.lang.Object
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Differences
- Direct Known Subclasses:
ClassificationDifferences,EntitySummaryDifferences,InstancePropertiesDifferences,RelationshipDifferences
General class for capturing differences. Captures the following areas:
- OnlyOnLeft - values that only appear on the 'left' object (the one from which differences were checked)
- OnlyOnRight - values that only appear on the 'right' object (the one passed as an argument when differences were calculated).
- Names - the names of the things that differ, including those from OnlyOnLeft, OnlyOnRight and where the thing has a value on both sides but that value is different
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the valid values for the differences.static class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOnlyOnOneSide(Differences.SidePresent side, String name, Object value) Add the provided name as only existing on one side.voidDetermine if there is a difference between the provided values, and capture either that difference or the similarity.getLeftValue(String name) Returns the value of the thing with the provided name from the first object used to create this diff.getNames()Returns the set of names of the things that differ.Returns a mapping of things (by name) that only appear on the first object used to create this diff.Returns a mapping of things (by name) that only appear on the second object used to create this diff.getRightValue(String name) Returns the value of the thing with the provided name from the second object used to create this diff.booleanReturns true if the two have any differences (are not equal), otherwise false.booleanisDifferent(String name) Returns true if the value mapped to the provided name differs, otherwise false if it is the same in both.
-
Constructor Details
-
Differences
public Differences()Construct a new set of differences.
-
-
Method Details
-
hasDifferences
public boolean hasDifferences()Returns true if the two have any differences (are not equal), otherwise false.- Returns:
- boolean
-
getNames
Returns the set of names of the things that differ.- Returns:
Set<String>
-
isDifferent
Returns true if the value mapped to the provided name differs, otherwise false if it is the same in both.- Parameters:
name- the name of the thing to check- Returns:
- boolean
-
getLeftValue
Returns the value of the thing with the provided name from the first object used to create this diff.- Parameters:
name- the name of the thing for which to retrieve the value- Returns:
- Object
-
getRightValue
Returns the value of the thing with the provided name from the second object used to create this diff.- Parameters:
name- the name of the thing for which to retrieve the value- Returns:
- Object
-
getOnlyOnLeft
Returns a mapping of things (by name) that only appear on the first object used to create this diff.- Returns:
Map<String, Object>
-
getOnlyOnRight
Returns a mapping of things (by name) that only appear on the second object used to create this diff.- Returns:
Map<String, Object>
-
check
Determine if there is a difference between the provided values, and capture either that difference or the similarity.- Parameters:
name- the property name that differsleft- the value in the first instanceright- the value in the second instance
-
addOnlyOnOneSide
Add the provided name as only existing on one side.- Parameters:
side- the side on which the value existsname- the name of the thing that points to the valuevalue- the value
-