1 package org.opendaylight.yangtools.yang.data.impl.schema.tree;
4 import com.google.common.base.Optional;
5 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
6 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
7 import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.TreeNode;
8 import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.Version;
11 * An implementation of apply operation which fails to do anything,
12 * consistently. An instance of this class is used by the data tree
13 * if it does not have a SchemaContext attached and hence cannot
14 * perform anything meaningful.
16 final class AlwaysFailOperation implements ModificationApplyOperation {
17 public static final ModificationApplyOperation INSTANCE = new AlwaysFailOperation();
19 private AlwaysFailOperation() {
24 public Optional<TreeNode> apply(final ModifiedNode modification,
25 final Optional<TreeNode> storeMeta, final Version version) {
26 throw new IllegalStateException("Schema Context is not available.");
30 public void checkApplicable(final YangInstanceIdentifier path,final NodeModification modification, final Optional<TreeNode> storeMetadata) {
31 throw new IllegalStateException("Schema Context is not available.");
35 public Optional<ModificationApplyOperation> getChild(final PathArgument child) {
36 throw new IllegalStateException("Schema Context is not available.");
40 public void verifyStructure(final ModifiedNode modification) {
41 throw new IllegalStateException("Schema Context is not available.");