Define a replacement for Restconf{Error,Exception,Future}
[netconf.git] / restconf / restconf-nb / src / main / java / org / opendaylight / restconf / server / api / DatabindPath.java
index 72e1fe45601289c2d322e96e35b20d0a96f27d77..481514cd125ecab8013c37d73470d325ae200a8f 100644 (file)
@@ -132,9 +132,18 @@ public sealed interface DatabindPath extends DatabindAware {
          * Returns the {@link YangInstanceIdentifier} of the instance being referenced.
          *
          * @return the {@link YangInstanceIdentifier} of the instance being referenced,
-         *         {@link YangInstanceIdentifier#empty()} denotes the datastora
+         *         {@link YangInstanceIdentifier#empty()} denotes the data root
          */
         YangInstanceIdentifier instance();
+
+        /**
+         * Returns this reference as a {@link ServerErrorPath}.
+         *
+         * @return this reference as a {@link ServerErrorPath}
+         */
+        default ServerErrorPath toErrorPath() {
+            return new ServerErrorPath(databind(), instance());
+        }
     }
 
     /**