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=786e906da04888149ad412be4b21a410be42791d;hb=49cd5a097d17058b1569d69d003187ec3ce52db0;hp=86acdf68e4b3853c54c5a970693cbedd53412314;hpb=25af5cac9dc66fe36021a1f4e224b64a3f7ac177;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 86acdf68e4..786e906da0 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,70 +7,35 @@ */ package org.opendaylight.yangtools.yang.model.api; -import com.google.common.base.Optional; +import java.util.Collection; import java.util.Map; -import java.util.Set; -import javax.annotation.Nonnull; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.model.api.DocumentedNode.WithStatus; +import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Descendant; /** - * Contains the methods for getting data and checking properties of the YANG - * uses substatement. + * Contains the methods for getting data and checking properties of the YANG uses substatement. */ -public interface UsesNode extends DocumentedNode.WithStatus { - +public interface UsesNode extends WhenConditionAware, WithStatus, CopyableNode { /** - * Returns the schema path to used grouping. + * Returns the {code grouping} which this node acted upon. * - * @return schema path to 'grouping' on which this 'uses' statement points + * @return Source grouping */ - @Nonnull SchemaPath getGroupingPath(); + @NonNull GroupingDefinition getSourceGrouping(); /** - * * Returns augmentations which were specified in this uses node. * * @return Set of augment statements defined under this uses node */ - @Nonnull Set getAugmentations(); - - /** - * Returns true if the data node was added by augmentation, - * otherwise returns false - * - * @return true if the data node was added by augmentation, - * otherwise returns false - */ - boolean isAugmenting(); + @NonNull Collection getAugmentations(); /** - * Returns true if the data node was added by uses statement, - * otherwise returns false - * - * @return true if the data node was added by uses statement, - * otherwise returns false - */ - boolean isAddedByUses(); - - /** - * Some of the properties of each node in the grouping can be refined with - * the "refine" statement. - * - * @return Map, where key is schema path of refined node and value is - * refined node - */ - @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. + * Some of the properties of each node in the grouping can be refined with the "refine" statement. * - * @return Optional of XPath condition + * @return Map, where key is schema node identifier of refined node and value is refined node. */ - default @Nonnull Optional getWhenCondition() { - return Optional.absent(); - } + // FIXME: I am not sure I understand why do we need to track these, who are the actual users? + @NonNull Map getRefines(); }