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;
13 import javax.annotation.Nonnull;
16 * Contains the methods for getting data and checking properties of the YANG
17 * <code>uses</code> substatement.
20 public interface UsesNode extends DocumentedNode.WithStatus {
23 * Returns the schema path to used grouping.
25 * @return schema path to 'grouping' on which this 'uses' statement points
27 @Nonnull SchemaPath getGroupingPath();
31 * Returns augmentations which were specified in this uses node.
33 * @return Set of augment statements defined under this uses node
35 @Nonnull Set<AugmentationSchema> getAugmentations();
38 * Returns <code>true</code> if the data node was added by augmentation,
39 * otherwise returns <code>false</code>
41 * @return <code>true</code> if the data node was added by augmentation,
42 * otherwise returns <code>false</code>
44 boolean isAugmenting();
47 * Returns <code>true</code> if the data node was added by uses statement,
48 * otherwise returns <code>false</code>
50 * @return <code>true</code> if the data node was added by uses statement,
51 * otherwise returns <code>false</code>
53 boolean isAddedByUses();
56 * Some of the properties of each node in the grouping can be refined with
57 * the "refine" statement.
59 * @return Map, where key is schema path of refined node and value is
62 @Nonnull Map<SchemaPath, SchemaNode> getRefines();
65 * Returns when statement
67 * If when condition is present node defined by the parent data definition
68 * statement is only valid when the returned XPath expression conceptually
69 * evaluates to "true" for a particular instance, then the node defined by
70 * the parent data definition statement is valid; otherwise, it is not.
72 * @return Optional of XPath condition
74 default @Nonnull Optional<RevisionAwareXPath> getWhenCondition() {
75 return Optional.absent();