41edf5d21ad0922a617a14a7a648221dcb5fde05
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / AlwaysFailOperation.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. 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 /**
11  * An implementation of apply operation which fails to do anything, consistently. An instance of this class is used by
12  * the data tree if it does not have a SchemaContext attached and hence cannot perform anything meaningful.
13  */
14 final class AlwaysFailOperation extends FullyDelegatedModificationApplyOperation {
15     static final ModificationApplyOperation INSTANCE = new AlwaysFailOperation();
16
17     private AlwaysFailOperation() {
18
19     }
20
21     @Override
22     ModificationApplyOperation delegate() {
23         throw new IllegalStateException("Schema Context is not available.");
24     }
25 }