Interface SnapshotNode

All Known Implementing Classes:
ArraySnapshotNode, ClassSnapshotNode, MapSnapshotNode, ReferenceSnapshotNode

public interface SnapshotNode
Snapshot of an object.
Author:
Peter Lamby
  • Method Details

    • value

      Object value()
      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.

      Returns:
      The value that was used to create the snapshot.
    • diff

      DifferenceNode diff(@Nullable SnapshotNode other, String path)
      Compare this node to the other one.

      path is used to provide context to the returned DifferenceNode.

      Parameters:
      other - The other node.
      path - The relative path of this and other.
      Returns:
      a DifferenceNode describing the differences. Never null.
    • doDiff

      static DifferenceNode doDiff(@Nullable SnapshotNode a, @Nullable SnapshotNode b, String path)
      Helper to compare two SnapshotNodes that are null safe.

      path is used to provide context to the returned DifferenceNode.

      Parameters:
      a - The node to compare.
      b - The node to compare.
      path - The relative path of a and b.
      Returns:
      a DifferenceNode describing the differences.