package org.opendaylight.yangtools.yang.data.impl.schema.tree;
import static com.google.common.base.Preconditions.checkArgument;
+
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
}
@Override
- protected void verifyWrittenStructure(final NormalizedNode<?, ?> writtenValue) {
+ protected final void verifyStructure(final NormalizedNode<?, ?> writtenValue, final boolean verifyChildren) {
checkArgument(nodeClass.isInstance(writtenValue), "Node should must be of type %s", nodeClass);
}
@Override
- public Optional<ModificationApplyOperation> getChild(final PathArgument child) {
+ public final Optional<ModificationApplyOperation> getChild(final PathArgument child) {
throw new UnsupportedOperationException("Node " + schema.getPath()
+ "is leaf type node. Child nodes not allowed");
}
@Override
- protected TreeNode applySubtreeChange(final ModifiedNode modification,
+ protected final ChildTrackingPolicy getChildPolicy() {
+ return ChildTrackingPolicy.NONE;
+ }
+
+ @Override
+ 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.");
}
@Override
- protected TreeNode applyMerge(final ModifiedNode modification, final TreeNode currentMeta,
+ protected final TreeNode applyMerge(final ModifiedNode modification, final TreeNode currentMeta,
final Version version) {
// Just overwrite whatever was there
modification.resolveModificationType(ModificationType.WRITE);
}
@Override
- protected TreeNode applyWrite(final ModifiedNode modification,
+ protected final TreeNode applyWrite(final ModifiedNode modification,
final Optional<TreeNode> currentMeta, final Version version) {
- return TreeNodeFactory.createTreeNodeRecursively(modification.getWrittenValue(), version);
+ return TreeNodeFactory.createTreeNode(modification.getWrittenValue(), version);
}
@Override
- protected void checkSubtreeModificationApplicable(final YangInstanceIdentifier path, final NodeModification modification,
+ protected final void checkTouchApplicable(final YangInstanceIdentifier path, final NodeModification modification,
final Optional<TreeNode> current) throws IncorrectDataStructureException {
throw new IncorrectDataStructureException(path, "Subtree modification is not allowed.");
}