public abstract class Differences extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Differences.SidePresent |
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Differences.ValuePair> |
differing |
protected Map<String,Object> |
matching |
protected Map<String,Object> |
onlyOnLeft |
protected Map<String,Object> |
onlyOnRight |
| Constructor and Description |
|---|
Differences()
Construct a new set of differences.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addDiffering(String name,
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Differences.ValuePair valuePair)
Add the provided name as a differing thing.
|
protected void |
addMatching(String name,
Object value)
Add the provided name as a matching thing.
|
void |
addOnlyOnOneSide(Differences.SidePresent side,
String name,
Object value)
Add the provided name as only existing on one side.
|
void |
check(String name,
Object left,
Object right)
Determine if there is a difference between the provided values, and capture either that difference or the
similarity.
|
Object |
getLeftValue(String name)
Returns the value of the thing with the provided name from the first object used to create this diff.
|
Set<String> |
getNames()
Returns the set of names of the things that differ.
|
Map<String,Object> |
getOnlyOnLeft()
Returns a mapping of things (by name) that only appear on the first object used to create this diff.
|
Map<String,Object> |
getOnlyOnRight()
Returns a mapping of things (by name) that only appear on the second object used to create this diff.
|
Object |
getRightValue(String name)
Returns the value of the thing with the provided name from the second object used to create this diff.
|
boolean |
hasDifferences()
Returns true if the two have any differences (are not equal), otherwise false.
|
boolean |
isDifferent(String name)
Returns true if the value mapped to the provided name differs, otherwise false if it is the same in both.
|
protected Map<String,org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Differences.ValuePair> differing
public boolean hasDifferences()
public Set<String> getNames()
Set<String>public boolean isDifferent(String name)
name - the name of the thing to checkpublic Object getLeftValue(String name)
name - the name of the thing for which to retrieve the valuepublic Object getRightValue(String name)
name - the name of the thing for which to retrieve the valuepublic Map<String,Object> getOnlyOnLeft()
Map<String, Object>public Map<String,Object> getOnlyOnRight()
Map<String, Object>public void check(String name, Object left, Object right)
name - the property name that differsleft - the value in the first instanceright - the value in the second instancepublic void addOnlyOnOneSide(Differences.SidePresent side, String name, Object value)
side - the side on which the value existsname - the name of the thing that points to the valuevalue - the valueprotected void addMatching(String name, Object value)
name - the name of the matching thingvalue - the value that is the same across bothprotected void addDiffering(String name, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Differences.ValuePair valuePair)
name - the name of the differing thingvaluePair - the value for eachCopyright © 2018–2020 ODPi. All rights reserved.