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 com.google.common.base.Optional;
11 import com.google.common.collect.ImmutableList;
12 import java.util.List;
17 * Contains the methods for getting data and checking properties of the YANG
18 * <code>uses</code> substatement.
21 public interface UsesNode extends DocumentedNode {
24 * Returns the schema path to used grouping.
26 * @return schema path to 'grouping' on which this 'uses' statement points
28 SchemaPath getGroupingPath();
32 * Returns augmentations which were specified in this uses node.
34 * @return Set of augment statements defined under this uses node
36 Set<AugmentationSchema> getAugmentations();
39 * Returns <code>true</code> if the data node was added by augmentation,
40 * otherwise returns <code>false</code>
42 * @return <code>true</code> if the data node was added by augmentation,
43 * otherwise returns <code>false</code>
45 boolean isAugmenting();
48 * Returns <code>true</code> if the data node was added by uses statement,
49 * otherwise returns <code>false</code>
51 * @return <code>true</code> if the data node was added by uses statement,
52 * otherwise returns <code>false</code>
54 boolean isAddedByUses();
57 * Some of the properties of each node in the grouping can be refined with
58 * the "refine" statement.
60 * @return Map, where key is schema path of refined node and value is
63 Map<SchemaPath, SchemaNode> getRefines();
66 * Returns when statement
68 * If when condition is present node defined by the parent data definition
69 * statement is only valid when the returned XPath expression conceptually
70 * evaluates to "true" for a particular instance, then the node defined by
71 * the parent data definition statement is valid; otherwise, it is not.
73 * @return Optional of XPath condition
75 default Optional<RevisionAwareXPath> getWhenCondition() {
76 return Optional.absent();
81 * Returns unknown schema nodes which belongs to this instance of the type
82 * <code>UsesNode</code>.
84 * @return list of unknown schema nodes defined under this uses node.
86 default List<UnknownSchemaNode> getUnknownSchemaNodes() {
87 return ImmutableList.of();