Bump Xtend to 2.35.0
[yangtools.git] / model / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / stmt / ConfigEffectiveStatement.java
1 /*
2  * Copyright (c) 2016 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.model.api.stmt;
9
10 import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
11 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
12 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
13
14 /**
15  * Effective representation of a {@code config} statement.
16  *
17  * <p>
18  * Note that unlike almost all other representations, these statements are only ever a reflection of a declared
19  * {@code config} statement. The truly effective status of a particular statement within a tree depends on its parent
20  * statements. As an example, given this YANG module:
21  * <pre>
22  *   <code>
23  *     module foo {
24  *
25  *       grouping foo {
26  *         leaf baz {
27  *           type string;
28  *         }
29  *       }
30  *
31  *       container bar {
32  *         config false;
33  *         uses foo;
34  *       }
35  *
36  *       uses bar;
37  *     }
38  *   </code>
39  * </pre>
40  * The object model will only reflect the {@code config} statement in {@code container bar}, but will not be present in
41  * {@code bar}'s {@code baz} leaf. The real effective {@code config} of {@code leaf baz} is a tri-state value:
42  * <ol>
43  *   <li>within {@code grouping foo} it is not applicable, that is to say undefined</li>
44  *   <li>within {@code container bar} it is inherited, that is to say {@code false}</li>
45  *   <li>within {@code module foo} it is inherited from default, that is to say {@code true}</li>
46  * </ol>
47  *
48  * <p>
49  * Users are advised to use utility classes related to statement inference which consider parent/child relationships
50  * of statements.
51  */
52 public interface ConfigEffectiveStatement extends EffectiveStatement<Boolean, ConfigStatement> {
53     @Override
54     default  StatementDefinition statementDefinition() {
55         return YangStmtMapping.CONFIG;
56     }
57 }