Separate out ModificationApplyOperation.verifyStructure()
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / DelegatingModificationApplyOperation.java
1 /*
2  * Copyright (c) 2019 Pantheon Technologies, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.yang.data.impl.schema.tree;
9
10 import java.util.Optional;
11 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
12 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
13 import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.Version;
14
15 abstract class DelegatingModificationApplyOperation extends ModificationApplyOperation {
16     @Override
17     final ChildTrackingPolicy getChildPolicy() {
18         return delegate().getChildPolicy();
19     }
20
21     @Override
22     final void mergeIntoModifiedNode(final ModifiedNode node, final NormalizedNode<?, ?> value, final Version version) {
23         delegate().mergeIntoModifiedNode(node, value, version);
24     }
25
26     @Override
27     public final Optional<ModificationApplyOperation> getChild(final PathArgument child) {
28         return delegate().getChild(child);
29     }
30
31     @Override
32     final void quickVerifyStructure(final NormalizedNode<?, ?> modification) {
33         delegate().quickVerifyStructure(modification);
34     }
35
36     @Override
37     final void recursivelyVerifyStructure(final NormalizedNode<?, ?> value) {
38         delegate().recursivelyVerifyStructure(value);
39     }
40
41     /**
42      * Return the underlying delegate.
43      *
44      * @return Underlying delegate.
45      */
46     abstract ModificationApplyOperation delegate();
47 }