Fix leafref require-instance implementation
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / ConstraintDefinition.java
index c201545d8ca98849f3aa3cd6f51a350626a768c3..30b690df52bf79ee0b093c2066d0d37b0fd09e29 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.yangtools.yang.model.api;
 
 import java.util.Set;
+import javax.annotation.Nullable;
 
 /**
  * Contains method which returns various data constraints for some YANG element
@@ -21,7 +22,7 @@ public interface ConstraintDefinition {
      * Specifies the condition when the data node which contains
      * <code>when</code> YANG substatement has to be present. If XPath
      * expression is evaluated as true then the data node has to be present.
-     * 
+     *
      * @return XPath expression.
      */
     RevisionAwareXPath getWhenCondition();
@@ -29,8 +30,8 @@ public interface ConstraintDefinition {
     /**
      * Specifies the rules which the node which contains <code>must</code> YANG
      * substatement has to match.
-     * 
-     * 
+     *
+     *
      * @return set of <code>MustDefinition</code> (XPath) instances which
      *         represents the concrete data constraints
      */
@@ -39,11 +40,11 @@ public interface ConstraintDefinition {
     /**
      * Expreses if the presence of the data element for which this constraint is
      * specified is|isn't required.
-     * 
+     *
      * Contains the value of the <b>mandatory</b> YANG substatement.
-     * 
+     *
      * It is used with YANG statements leaf, choice, anyxml, deviate.
-     * 
+     *
      * @return boolean value:
      *         <ul>
      *         <li>true - if <code>mandatory</code> YANG keyword argument =
@@ -57,26 +58,26 @@ public interface ConstraintDefinition {
     /**
      * Returns the minimum required number of data elements for node where this
      * constraint is specified.
-     * 
+     *
      * The returning value equals to value of the argument of the
      * <b>min-elements</b> YANG substatement.
-     * 
+     *
      * It is used with YANG statements leaf-list, list, deviate.
-     * 
-     * @return integer with minimal number of elements
+     *
+     * @return integer with minimal number of elements, or null if no minimum is defined
      */
-    Integer getMinElements();
+    @Nullable Integer getMinElements();
 
     /**
      * Returns the maximum admissible number of data elements for node where
      * this constraint is specified.
-     * 
+     *
      * The returning value equals to value of the argument of the
      * <b>max-elements</b> YANG substatement.
-     * 
+     *
      * It is used with YANG statements leaf-list, list, deviate.
-     * 
-     * @return integer with maximum number of elements
+     *
+     * @return integer with maximum number of elements, or null if no maximum is defined
      */
-    Integer getMaxElements();
+    @Nullable Integer getMaxElements();
 }