Migrate default method implementations to model.api
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / Deviation.java
index 59cdf06072a016f1c2b90ac0819e49b7da4a5627..f9b31d3e2ce9c4ae8241486277e96b6dad2b526d 100644 (file)
@@ -9,6 +9,7 @@ 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;
 
 /**
@@ -18,13 +19,15 @@ import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absol
  * 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 node absolute schema node identifier.
      *
      * @return An identifier that points to the node in the schema tree where a deviation from the module occurs.
      */
-    @NonNull Absolute getTargetPath();
+    default @NonNull Absolute getTargetPath() {
+        return asEffectiveStatement().argument();
+    }
 
     /**
      * Returns deviate children.