X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-model-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fmodel%2Fapi%2FUsesNode.java;h=86acdf68e4b3853c54c5a970693cbedd53412314;hb=refs%2Fchanges%2F57%2F44657%2F8;hp=8f783c1516f2a92c2cfcf06618bd3fea1bbee2bd;hpb=475f8732893197eb41bfa695a4c7dedb45f25f06;p=yangtools.git diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/UsesNode.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/UsesNode.java index 8f783c1516..86acdf68e4 100644 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/UsesNode.java +++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/UsesNode.java @@ -7,30 +7,31 @@ */ package org.opendaylight.yangtools.yang.model.api; +import com.google.common.base.Optional; import java.util.Map; import java.util.Set; +import javax.annotation.Nonnull; /** * Contains the methods for getting data and checking properties of the YANG * uses substatement. - * */ -public interface UsesNode extends YangNode { +public interface UsesNode extends DocumentedNode.WithStatus { /** * Returns the schema path to used grouping. * * @return schema path to 'grouping' on which this 'uses' statement points */ - SchemaPath getGroupingPath(); + @Nonnull SchemaPath getGroupingPath(); /** * - * Returns agumentations which were specified in this uses node. + * Returns augmentations which were specified in this uses node. * * @return Set of augment statements defined under this uses node */ - Set getAugmentations(); + @Nonnull Set getAugmentations(); /** * Returns true if the data node was added by augmentation, @@ -57,5 +58,19 @@ public interface UsesNode extends YangNode { * @return Map, where key is schema path of refined node and value is * refined node */ - Map getRefines(); + @Nonnull Map getRefines(); + + /** + * Returns when statement + * + * If when condition is present node defined by the parent data definition + * statement is only valid when the returned XPath expression conceptually + * evaluates to "true" for a particular instance, then the node defined by + * the parent data definition statement is valid; otherwise, it is not. + * + * @return Optional of XPath condition + */ + default @Nonnull Optional getWhenCondition() { + return Optional.absent(); + } }