Class AbstractDocumentNodeState
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.state.AbstractNodeState
-
- org.apache.jackrabbit.oak.plugins.document.AbstractDocumentNodeState
-
- All Implemented Interfaces:
NodeState
- Direct Known Subclasses:
DelegatingDocumentNodeState
,DocumentNodeState
public abstract class AbstractDocumentNodeState extends AbstractNodeState
-
-
Constructor Summary
Constructors Constructor Description AbstractDocumentNodeState()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
compareAgainstBaseState(NodeState base, NodeStateDiff diff)
Generic default comparison algorithm that simply walks through the property and child node lists of the given base state and compares the entries one by one with corresponding ones (if any) in this state.boolean
equals(Object that)
Checks whether the given object is equal to this one.abstract RevisionVector
getLastRevision()
protected abstract NodeStateDiffer
getNodeStateDiffer()
abstract Path
getPath()
abstract RevisionVector
getRootRevision()
abstract boolean
hasNoChildren()
abstract boolean
isFromExternalChange()
abstract AbstractDocumentNodeState
withRootRevision(@NotNull RevisionVector root, boolean externalChange)
-
Methods inherited from class org.apache.jackrabbit.oak.spi.state.AbstractNodeState
checkValidName, compareAgainstBaseState, comparePropertiesAgainstBaseState, count, equals, getBoolean, getBoolean, getChildNodeCount, getChildNodeNames, getLong, getLong, getName, getName, getNames, getNames, getProperty, getPropertyCount, getString, getString, getStrings, getStrings, hashCode, hasProperty, isValidName, toString, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.jackrabbit.oak.spi.state.NodeState
builder, exists, getChildNode, getChildNodeEntries, getProperties, hasChildNode
-
-
-
-
Method Detail
-
getPath
public abstract Path getPath()
-
getLastRevision
public abstract RevisionVector getLastRevision()
-
getRootRevision
public abstract RevisionVector getRootRevision()
-
isFromExternalChange
public abstract boolean isFromExternalChange()
-
withRootRevision
public abstract AbstractDocumentNodeState withRootRevision(@NotNull @NotNull RevisionVector root, boolean externalChange)
Creates a copy of thisDocumentNodeState
with thegetRootRevision()
set to the givenroot
revision. This method returnsthis
instance if the givenroot
revision is the same as the one in this instance and theisFromExternalChange()
flags are equal.- Parameters:
root
- the root revision for the copy of this node state.externalChange
- if theisFromExternalChange()
flag must be set on the returned node state.- Returns:
- a copy of this node state with the given root revision and external change flag.
-
hasNoChildren
public abstract boolean hasNoChildren()
-
getNodeStateDiffer
protected abstract NodeStateDiffer getNodeStateDiffer()
-
equals
public boolean equals(Object that)
Description copied from class:AbstractNodeState
Checks whether the given object is equal to this one. Two node states are considered equal if all their properties and child nodes match, regardless of ordering. Subclasses may override this method with a more efficient equality check if one is available.- Overrides:
equals
in classAbstractNodeState
- Parameters:
that
- target of the comparison- Returns:
true
if the objects are equal,false
otherwise
-
compareAgainstBaseState
public boolean compareAgainstBaseState(NodeState base, NodeStateDiff diff)
Description copied from class:AbstractNodeState
Generic default comparison algorithm that simply walks through the property and child node lists of the given base state and compares the entries one by one with corresponding ones (if any) in this state.- Specified by:
compareAgainstBaseState
in interfaceNodeState
- Overrides:
compareAgainstBaseState
in classAbstractNodeState
- Parameters:
base
- base statediff
- handler of node state differences- Returns:
true
if the full diff was performed, orfalse
if it was aborted as requested by the handler (see theNodeStateDiff
contract for more details)
-
-