Make getIfFeaturePredicate() a default method
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / UsesNode.java
index eb8b27a4317c5d0c54a1dfe4cccf5df9413857ba..f8e163cbf186f059bffdb450c2e6d15e5bfb9d21 100644 (file)
@@ -7,70 +7,33 @@
  */
 package org.opendaylight.yangtools.yang.model.api;
 
-import com.google.common.base.Optional;
 import java.util.Map;
 import java.util.Set;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.yangtools.yang.model.api.DocumentedNode.WithStatus;
 
 /**
- * Contains the methods for getting data and checking properties of the YANG
- * <code>uses</code> substatement.
- *
+ * Contains the methods for getting data and checking properties of the YANG <code>uses</code> substatement.
  */
-public interface UsesNode extends DocumentedNode {
-
+public interface UsesNode extends WhenConditionAware, WithStatus, CopyableNode {
     /**
      * Returns the schema path to used grouping.
      *
      * @return schema path to 'grouping' on which this 'uses' statement points
      */
-    SchemaPath getGroupingPath();
+    @NonNull SchemaPath getGroupingPath();
 
     /**
-     *
      * Returns augmentations which were specified in this uses node.
      *
      * @return Set of augment statements defined under this uses node
      */
-    Set<AugmentationSchema> getAugmentations();
-
-    /**
-     * Returns <code>true</code> if the data node was added by augmentation,
-     * otherwise returns <code>false</code>
-     *
-     * @return <code>true</code> if the data node was added by augmentation,
-     *         otherwise returns <code>false</code>
-     */
-    boolean isAugmenting();
-
-    /**
-     * Returns <code>true</code> if the data node was added by uses statement,
-     * otherwise returns <code>false</code>
-     *
-     * @return <code>true</code> if the data node was added by uses statement,
-     *         otherwise returns <code>false</code>
-     */
-    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
-     */
-    Map<SchemaPath, SchemaNode> getRefines();
+    @NonNull Set<AugmentationSchemaNode> getAugmentations();
 
     /**
-     * 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 path of refined node and value is refined node
      */
-    default Optional<RevisionAwareXPath> getWhenCondition() {
-        return Optional.absent();
-    }
+    @NonNull Map<SchemaPath, SchemaNode> getRefines();
 }