protected TreeNode applyMerge(final ModifiedNode modification, final TreeNode currentMeta,
final Version version) {
// For Node Containers - merge is same as subtree change - we only replace children.
- return applySubtreeChange(modification, currentMeta, version);
+ return applyTouch(modification, currentMeta, version);
}
@Override
- public TreeNode applySubtreeChange(final ModifiedNode modification,
+ public TreeNode applyTouch(final ModifiedNode modification,
final TreeNode currentMeta, final Version version) {
final MutableTreeNode newMeta = currentMeta.mutable();
newMeta.setSubtreeVersion(version);
}
@Override
- protected final TreeNode applySubtreeChange(final ModifiedNode modification,
+ protected final TreeNode applyTouch(final ModifiedNode modification,
final TreeNode currentMeta, final Version version) {
throw new UnsupportedOperationException("Node " + schema.getPath()
+ "is leaf type node. Subtree change is not allowed.");
case TOUCH:
Preconditions.checkArgument(currentMeta.isPresent(), "Metadata not available for modification",
modification);
- return modification.setSnapshot(Optional.of(applySubtreeChange(modification, currentMeta.get(),
+ return modification.setSnapshot(Optional.of(applyTouch(modification, currentMeta.get(),
version)));
case MERGE:
final TreeNode result;
* @param version New subtree version of parent node
* @return A sealed TreeNode representing applied operation.
*/
- protected abstract TreeNode applySubtreeChange(ModifiedNode modification, TreeNode currentMeta, Version version);
+ protected abstract TreeNode applyTouch(ModifiedNode modification, TreeNode currentMeta, Version version);
/**
*
}
@Override
- protected TreeNode applySubtreeChange(final ModifiedNode modification,
+ protected TreeNode applyTouch(final ModifiedNode modification,
final TreeNode currentMeta, final Version version) {
throw new UnsupportedOperationException("UnkeyedList does not support subtree change.");
}