Populate data/ hierarchy
[yangtools.git] / model / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / DataSchemaNode.java
1 /*
2  * Copyright (c) 2013 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;
9
10 import java.util.Optional;
11
12 /**
13  * Data Schema Node represents abstract supertype from which all data tree definitions are derived. Unlike what
14  * the name would suggest, this interface corresponds more to RFC7950 {@code data definition statement} than to
15  * {@code data node}, yet it notably does not include {@link UsesNode} and {@link AugmentationSchemaNode}, which are
16  * resolved separately.
17  *
18  * <p>
19  * Common interface is composed of {@link #isConfiguration()}, governing validity in config/operation data stores
20  * and {@link WhenConditionAware} mixin, which governs validity based on other document data.
21  *
22  * @see ContainerSchemaNode
23  * @see ListSchemaNode
24  * @see LeafListSchemaNode
25  * @see ChoiceSchemaNode
26  * @see CaseSchemaNode
27  * @see LeafSchemaNode
28  * @see AnyxmlSchemaNode
29  * @see AnydataSchemaNode
30  */
31 public interface DataSchemaNode extends SchemaNode, CopyableNode, WhenConditionAware {
32     /**
33      * Returns {@code true} if the data represents configuration data, otherwise returns {@code false}.
34      *
35      * @return {@code true} if the data represents configuration data, otherwise returns {@code false}
36      * @deprecated Use {@link #effectiveConfig()} instead.
37      */
38     @Deprecated(forRemoval = true)
39     default boolean isConfiguration() {
40         return effectiveConfig().orElse(Boolean.TRUE);
41     }
42
43     /**
44      * Return the effective value of {@code config} substatement, if applicable.
45      *
46      * @return Effective {@code config} value, or {@link Optional#empty()} not applicable.
47      */
48     Optional<Boolean> effectiveConfig();
49 }