Class EqualsDiff

java.lang.Object
org.apache.jackrabbit.oak.spi.state.EqualsDiff
All Implemented Interfaces:
NodeStateDiff

public class EqualsDiff extends Object implements NodeStateDiff
Helper class for comparing the equality of node states based on the content diff mechanism.
  • Constructor Details

    • EqualsDiff

      public EqualsDiff()
  • Method Details

    • equals

      public static boolean equals(NodeState before, NodeState after)
      Diffs the given node states and returns true if there are no differences.
      Parameters:
      before - before state
      after - after state
      Returns:
      true if the states are equal, false otherwise
    • modified

      public static boolean modified(NodeState before, NodeState after)
      Diffs the given node states and returns true if there are differences within the properties or direct child nodes.
      Parameters:
      before - before state
      after - after state
      Returns:
      true if there are modifications, false otherwise
    • propertyAdded

      public boolean propertyAdded(org.apache.jackrabbit.oak.api.PropertyState after)
      Description copied from interface: NodeStateDiff
      Called for all added properties.
      Specified by:
      propertyAdded in interface NodeStateDiff
      Parameters:
      after - property state after the change
      Returns:
      true to continue the comparison, false to abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
    • propertyChanged

      public boolean propertyChanged(org.apache.jackrabbit.oak.api.PropertyState before, org.apache.jackrabbit.oak.api.PropertyState after)
      Description copied from interface: NodeStateDiff
      Called for all changed properties. The names of the given two property states are guaranteed to be the same.
      Specified by:
      propertyChanged in interface NodeStateDiff
      Parameters:
      before - property state before the change
      after - property state after the change
      Returns:
      true to continue the comparison, false to abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
    • propertyDeleted

      public boolean propertyDeleted(org.apache.jackrabbit.oak.api.PropertyState before)
      Description copied from interface: NodeStateDiff
      Called for all deleted properties.
      Specified by:
      propertyDeleted in interface NodeStateDiff
      Parameters:
      before - property state before the change
      Returns:
      true to continue the comparison, false to abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
    • childNodeAdded

      public boolean childNodeAdded(String name, NodeState after)
      Description copied from interface: NodeStateDiff
      Called for all added child nodes.
      Specified by:
      childNodeAdded in interface NodeStateDiff
      Parameters:
      name - name of the added child node
      after - child node state after the change
      Returns:
      true to continue the comparison, false to abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
    • childNodeChanged

      public boolean childNodeChanged(String name, NodeState before, NodeState after)
      Description copied from interface: NodeStateDiff
      Called for all child nodes that may contain changes between the before and after states. The comparison implementation is expected to make an effort to avoid calling this method on child nodes under which nothing has changed.
      Specified by:
      childNodeChanged in interface NodeStateDiff
      Parameters:
      name - name of the changed child node
      before - child node state before the change
      after - child node state after the change
      Returns:
      true to continue the comparison, false to abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
    • childNodeDeleted

      public boolean childNodeDeleted(String name, NodeState before)
      Description copied from interface: NodeStateDiff
      Called for all deleted child nodes.
      Specified by:
      childNodeDeleted in interface NodeStateDiff
      Parameters:
      name - name of the deleted child node
      before - child node state before the change
      Returns:
      true to continue the comparison, false to abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.