Class ClassSnapshotNode

java.lang.Object
de.serra.so_dirty.sn.ClassSnapshotNode
All Implemented Interfaces:
SnapshotNode

public class ClassSnapshotNode extends Object implements SnapshotNode
Snapshot of an class and its fields.
Author:
Peter Lamby
  • Constructor Details

    • ClassSnapshotNode

      public ClassSnapshotNode(Object value, Map<String,@Nullable SnapshotNode> fieldsToSnapshots)
      Constructs
      Parameters:
      value - The instance of the class.
      fieldsToSnapshots - a Map of field names to the corresponding SnapshotNode.
  • Method Details

    • value

      public Object value()
      Description copied from interface: SnapshotNode
      The value that was used to create the snapshot.

      Please not that the interior of the object may have been modified since the snapshot was taken.

      Specified by:
      value in interface SnapshotNode
      Returns:
      The value that was used to create the snapshot.
    • diff

      public DifferenceNode diff(@Nullable SnapshotNode other, String path)
      Description copied from interface: SnapshotNode
      Compare this node to the other one.

      path is used to provide context to the returned DifferenceNode.

      Specified by:
      diff in interface SnapshotNode
      Parameters:
      other - The other node.
      path - The relative path of this and other.
      Returns:
      a DifferenceNode describing the differences. Never null.