Improve {Action,Notification}NodeContainerCompat safety
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / ConstraintMetaDefinition.java
index ea2f7d3e68c601cdd1b2e37073b7737a4b13f3a0..a02851319bf14c0fc573db29631dbe496e588304 100644 (file)
@@ -7,41 +7,25 @@
  */
 package org.opendaylight.yangtools.yang.model.api;
 
+import java.util.Optional;
+
 /**
- * Contains methods which retrive values for description, error message, error
- * app tag and reference (to other document).
- * 
+ * Contains methods which retrieve values for description, error message, error app tag and reference (to some external
+ * definition, resource or similar).
  */
-public interface ConstraintMetaDefinition {
-
-    /**
-     * Returns the value of the argument of YANG <code>description</code>
-     * keyword.
-     * 
-     * @return string with the description
-     */
-    String getDescription();
-
-    /**
-     * Returns the value of the argument of YANG <code>error-app-tag</code>
-     * keyword.
-     * 
-     * @return string with the application tag
-     */
-    String getErrorAppTag();
+public interface ConstraintMetaDefinition extends DocumentedNode {
 
     /**
-     * Returns the value of the argument of YANG <code>error-message</code>
-     * keyword.
-     * 
-     * @return string with the error message
+     * Returns the value of the argument of YANG <code>error-app-tag</code> keyword.
+     *
+     * @return string with the application tag, or empty if it was not provided.
      */
-    String getErrorMessage();
+    Optional<String> getErrorAppTag();
 
     /**
-     * Returns the value of the argument of YANG <code>reference</code> keyword.
-     * 
-     * @return string with reference to some other document
+     * Returns the value of the argument of YANG <code>error-message</code> keyword.
+     *
+     * @return string with the error message, or empty if it was not provided.
      */
-    String getReference();
+    Optional<String> getErrorMessage();
 }