Class EqualsDiff
java.lang.Object
org.apache.jackrabbit.oak.spi.state.EqualsDiff
- All Implemented Interfaces:
NodeStateDiff
Helper class for comparing the equality of node states based on the
content diff mechanism.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanchildNodeAdded(String name, NodeState after) Called for all added child nodes.booleanchildNodeChanged(String name, NodeState before, NodeState after) Called for all child nodes that may contain changes between the before and after states.booleanchildNodeDeleted(String name, NodeState before) Called for all deleted child nodes.static booleanDiffs the given node states and returnstrueif there are no differences.static booleanDiffs the given node states and returnstrueif there are differences within the properties or direct child nodes.booleanpropertyAdded(PropertyState after) Called for all added properties.booleanpropertyChanged(PropertyState before, PropertyState after) Called for all changed properties.booleanpropertyDeleted(PropertyState before) Called for all deleted properties.
-
Constructor Details
-
EqualsDiff
public EqualsDiff()
-
-
Method Details
-
equals
Diffs the given node states and returnstrueif there are no differences.- Parameters:
before- before stateafter- after state- Returns:
trueif the states are equal,falseotherwise
-
modified
Diffs the given node states and returnstrueif there are differences within the properties or direct child nodes.- Parameters:
before- before stateafter- after state- Returns:
trueif there are modifications,falseotherwise
-
propertyAdded
Description copied from interface:NodeStateDiffCalled for all added properties.- Specified by:
propertyAddedin interfaceNodeStateDiff- Parameters:
after- property state after the change- Returns:
trueto continue the comparison,falseto abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-
propertyChanged
Description copied from interface:NodeStateDiffCalled for all changed properties. The names of the given two property states are guaranteed to be the same.- Specified by:
propertyChangedin interfaceNodeStateDiff- Parameters:
before- property state before the changeafter- property state after the change- Returns:
trueto continue the comparison,falseto abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-
propertyDeleted
Description copied from interface:NodeStateDiffCalled for all deleted properties.- Specified by:
propertyDeletedin interfaceNodeStateDiff- Parameters:
before- property state before the change- Returns:
trueto continue the comparison,falseto abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-
childNodeAdded
Description copied from interface:NodeStateDiffCalled for all added child nodes.- Specified by:
childNodeAddedin interfaceNodeStateDiff- Parameters:
name- name of the added child nodeafter- child node state after the change- Returns:
trueto continue the comparison,falseto abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-
childNodeChanged
Description copied from interface:NodeStateDiffCalled 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:
childNodeChangedin interfaceNodeStateDiff- Parameters:
name- name of the changed child nodebefore- child node state before the changeafter- child node state after the change- Returns:
trueto continue the comparison,falseto abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-
childNodeDeleted
Description copied from interface:NodeStateDiffCalled for all deleted child nodes.- Specified by:
childNodeDeletedin interfaceNodeStateDiff- Parameters:
name- name of the deleted child nodebefore- child node state before the change- Returns:
trueto continue the comparison,falseto abort. Abort will stop comparing completely, that means sibling nodes and sibling nodes of all parents are not further compared.
-