Class GraphComparator.Delta

java.lang.Object
com.cedarsoftware.util.GraphComparator.Delta
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
GraphComparator.DeltaError
Enclosing class:
GraphComparator

public static class GraphComparator.Delta extends Object implements Serializable
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:
  • 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 difference
      fieldName - name of the field that differs
      srcPtr - pointer within the source graph
      srcValue - value from the source graph
      targetValue - value from the target graph
      optKey - optional key used by certain collection operations
  • Method Details

    • getId

      public Object getId()
      Returns:
      identifier of the object containing the change
    • setId

      public void setId(Object id)
      Update the identifier associated with this delta.
    • getFieldName

      public String getFieldName()
      Returns:
      the name of the field where the difference occurred
    • setFieldName

      public void setFieldName(String fieldName)
      Set the name of the field where the difference occurred.
      Parameters:
      fieldName - name of the differing field
    • getSourceValue

      public Object getSourceValue()
      Returns:
      value from the source graph
    • setSourceValue

      public void setSourceValue(Object srcValue)
    • getTargetValue

      public Object getTargetValue()
      Returns:
      value from the target graph
    • setTargetValue

      public void setTargetValue(Object targetValue)
    • getOptionalKey

      public Object getOptionalKey()
      Returns:
      optional key used for collection operations
    • setOptionalKey

      public void setOptionalKey(Object optionalKey)
    • getCmd

      Returns:
      command describing the modification type
    • setCmd

      public void setCmd(GraphComparator.Delta.Command cmd)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object