Add DataNodeContainer.dataChildByName()
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / Deviation.java
index 50e24dd819a044404d661539060dc9fb0bd68a9f..f9b31d3e2ce9c4ae8241486277e96b6dad2b526d 100644 (file)
@@ -9,6 +9,8 @@ package org.opendaylight.yangtools.yang.model.api;
 
 import java.util.Collection;
 import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.yangtools.yang.model.api.stmt.DeviationEffectiveStatement;
+import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute;
 
 /**
  * Interface describing YANG 'deviation' statement.
@@ -17,14 +19,15 @@ import org.eclipse.jdt.annotation.NonNull;
  * 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 extends DocumentedNode {
-
+public interface Deviation extends DocumentedNode, EffectiveStatementEquivalent<DeviationEffectiveStatement> {
     /**
-     * Returns target schema path.
+     * Returns target node absolute schema node identifier.
      *
-     * @return SchemaPath that identifies the node in the schema tree where a deviation from the module occurs.
+     * @return An identifier that points to the node in the schema tree where a deviation from the module occurs.
      */
-    SchemaPath getTargetPath();
+    default @NonNull Absolute getTargetPath() {
+        return asEffectiveStatement().argument();
+    }
 
     /**
      * Returns deviate children.