-
- private static int numOfChildrenFromChildMods(final ModifiedNode modification, final Optional<TreeNode> current) {
- int result = 0;
- for (final ModifiedNode modChild : modification.getChildren()) {
- switch (modChild.getOperation()) {
- case WRITE:
- result++;
- break;
- case MERGE:
- if (!current.isPresent()) {
- result++;
- }
- break;
- case DELETE:
- result--;
- break;
- case NONE:
- case TOUCH:
- // NOOP
- break;
- default:
- throw new IllegalArgumentException("Unsupported operation type: " + modChild.getOperation());
- }
- }
- return result;
- }
-
- @Override
- protected void checkTouchApplicable(final YangInstanceIdentifier path, final NodeModification modification,
- final Optional<TreeNode> current) throws DataValidationFailedException {
- delegate.checkTouchApplicable(path, modification, current);
- checkMinMaxElements(path, modification, current);
- }
-
- @Override
- protected void checkMergeApplicable(final YangInstanceIdentifier path, final NodeModification modification,
- final Optional<TreeNode> current) throws DataValidationFailedException {
- delegate.checkMergeApplicable(path, modification, current);
- checkMinMaxElements(path, modification, current);
- }
-
- @Override
- protected void checkWriteApplicable(final YangInstanceIdentifier path, final NodeModification modification,
- final Optional<TreeNode> current) throws DataValidationFailedException {
- delegate.checkWriteApplicable(path, modification, current);
- checkMinMaxElements(path, modification, current);
- }
-
-
- @Override
- public Optional<ModificationApplyOperation> getChild(final PathArgument child) {
- return delegate.getChild(child);
- }
-
- @Override
- protected void verifyStructure(final NormalizedNode<?, ?> modification, final boolean verifyChildren) {
- delegate.verifyStructure(modification, verifyChildren);
- }
-
- @Override
- protected TreeNode applyMerge(final ModifiedNode modification, final TreeNode currentMeta, final Version version) {
- return delegate.applyMerge(modification, currentMeta, version);
- }
-
- @Override
- protected TreeNode applyTouch(final ModifiedNode modification, final TreeNode currentMeta, final Version version) {
- return delegate.applyTouch(modification, currentMeta, version);
- }
-
- @Override
- protected TreeNode applyWrite(final ModifiedNode modification, final Optional<TreeNode> currentMeta,
- final Version version) {
- return delegate.applyWrite(modification, currentMeta, version);
- }
-
- @Override
- protected ChildTrackingPolicy getChildPolicy() {
- return delegate.getChildPolicy();
- }