Package com.cedarsoftware.util
Class GraphComparator.Delta
java.lang.Object
com.cedarsoftware.util.GraphComparator.Delta
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
GraphComparator.DeltaError
- Enclosing class:
- GraphComparator
Represents a single difference between two object graphs. A collection
of
Delta instances can be used to transform one graph so that it
matches another.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThese are all possible Delta.Commands that are generated when performing the graph comparison. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetCmd()getId()inthashCode()voidvoidsetFieldName(String fieldName) Set the name of the field where the difference occurred.voidUpdate the identifier associated with this delta.voidsetOptionalKey(Object optionalKey) voidsetSourceValue(Object srcValue) voidsetTargetValue(Object targetValue) toString()
-
Constructor Details
-
Delta
public Delta(Object id, String fieldName, String srcPtr, Object srcValue, Object targetValue, Object optKey) Construct a delta describing a change between two graphs.- Parameters:
id- identifier of the object containing the differencefieldName- name of the field that differssrcPtr- pointer within the source graphsrcValue- value from the source graphtargetValue- value from the target graphoptKey- optional key used by certain collection operations
-
-
Method Details
-
getId
- Returns:
- identifier of the object containing the change
-
setId
Update the identifier associated with this delta. -
getFieldName
- Returns:
- the name of the field where the difference occurred
-
setFieldName
Set the name of the field where the difference occurred.- Parameters:
fieldName- name of the differing field
-
getSourceValue
- Returns:
- value from the source graph
-
setSourceValue
-
getTargetValue
- Returns:
- value from the target graph
-
setTargetValue
-
getOptionalKey
- Returns:
- optional key used for collection operations
-
setOptionalKey
-
getCmd
- Returns:
- command describing the modification type
-
setCmd
-
toString
-
equals
-
hashCode
public int hashCode()
-