Refactor yang-model-api child traversal return types
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / Deviation.java
index 3a7cce85b546545f1c5f49b915a178e88cbb0991..50e24dd819a044404d661539060dc9fb0bd68a9f 100644 (file)
@@ -7,47 +7,29 @@
  */
 package org.opendaylight.yangtools.yang.model.api;
 
-import java.util.List;
+import java.util.Collection;
+import org.eclipse.jdt.annotation.NonNull;
 
 /**
  * Interface describing YANG 'deviation' statement.
+ *
  * <p>
- * The 'deviation' statement defines a hierarchy of a module that the device
- * does not implement faithfully. Deviations define the way a device deviate
- * from a standard.
- * </p>
+ * The 'deviation' statement defines a hierarchy of a module that the device does not implement faithfully. Deviations
+ * define the way a device deviate from a standard.
  */
-public interface Deviation {
-
-    /**
-     * Enum describing YANG deviation 'deviate' statement. It defines how the
-     * device's implementation of the target node deviates from its original
-     * definition.
-     */
-    enum Deviate {
-        NOT_SUPPORTED, ADD, REPLACE, DELETE
-    }
+public interface Deviation extends DocumentedNode {
 
     /**
-     * @return SchemaPath that identifies the node in the schema tree where a
-     *         deviation from the module occurs.
+     * Returns target schema path.
+     *
+     * @return SchemaPath that identifies the node in the schema tree where a deviation from the module occurs.
      */
     SchemaPath getTargetPath();
 
     /**
-     * @return deviate statement of this deviation
+     * Returns deviate children.
+     *
+     * @return Collection of all deviate statements defined in this deviation.
      */
-    Deviate getDeviate();
-
-    /**
-     * @return textual cross-reference to an external document that provides
-     *         additional information relevant to this node.
-     */
-    String getReference();
-
-    /**
-     * @return collection of all unknown nodes defined under this schema node.
-     */
-    List<UnknownSchemaNode> getUnknownSchemaNodes();
-
+    @NonNull Collection<? extends DeviateDefinition> getDeviates();
 }