dd37928b61e98fd62545fc8029b4784096b09339
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / FullyDelegatedModificationApplyOperation.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.schema.NormalizedNode;
12 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
13 import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.TreeNode;
14 import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.Version;
15
16 /**
17  * A {@link ModificationApplyOperation} which delegates all invocations to a backing instance.
18  */
19 abstract class FullyDelegatedModificationApplyOperation extends DelegatingModificationApplyOperation {
20     @Override
21     final Optional<TreeNode> apply(final ModifiedNode modification, final Optional<TreeNode> currentMeta,
22             final Version version) {
23         return delegate().apply(modification, currentMeta, version);
24     }
25
26     @Override
27     final void checkApplicable(final ModificationPath path, final NodeModification modification,
28             final Optional<TreeNode> current, final Version version) throws DataValidationFailedException {
29         delegate().checkApplicable(path, modification, current, version);
30     }
31
32     @Override
33     final void verifyStructure(final NormalizedNode<?, ?> modification, final boolean verifyChildren) {
34         delegate().verifyStructure(modification, verifyChildren);
35     }
36 }