2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.model.api;
10 import java.util.Optional;
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.
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.
22 * @see ContainerSchemaNode
24 * @see LeafListSchemaNode
25 * @see ChoiceSchemaNode
28 * @see AnyxmlSchemaNode
29 * @see AnydataSchemaNode
31 public interface DataSchemaNode extends SchemaNode, CopyableNode, WhenConditionAware {
33 * Returns {@code true} if the data represents configuration data, otherwise returns {@code false}.
35 * @return {@code true} if the data represents configuration data, otherwise returns {@code false}
36 * @deprecated Use {@link #effectiveConfig()} instead.
38 @Deprecated(forRemoval = true)
39 default boolean isConfiguration() {
40 return effectiveConfig().orElse(Boolean.TRUE);
44 * Return the effective value of {@code config} substatement, if applicable.
46 * @return Effective {@code config} value, or {@link Optional#empty()} not applicable.
48 Optional<Boolean> effectiveConfig();