Added javadoc and RFC references to Java YANG model. 82/82/1
authorLukas Sedlak <lsedlak@cisco.com>
Thu, 28 Mar 2013 12:09:04 +0000 (13:09 +0100)
committerTony Tkacik <ttkacik@cisco.com>
Thu, 28 Mar 2013 12:15:50 +0000 (13:15 +0100)
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/model/api/type/BinaryTypeDefinition.java
opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/model/api/type/IntegerTypeDefinition.java
opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/model/api/type/LengthConstraint.java
opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/model/api/type/RangeConstraint.java
opendaylight/sal/yang-prototype/yang/yang-model-api/src/main/java/org/opendaylight/controller/yang/model/api/TypeDefinition.java

index e99bbb14c66cecbc76f04ee78e1d60a2afd771cd..91031737c42964b9e229620d893de7e6fbcc32ed 100644 (file)
@@ -20,16 +20,23 @@ import org.opendaylight.controller.yang.model.api.TypeDefinition;
  * 4</a>). <br>\r
  * The canonical form of a binary value follows the rules in <a\r
  * href="https://tools.ietf.org/html/rfc4648">[RFC4648]</a>.\r
- *\r
- *\r
+ * \r
+ * <br>\r
+ * <br>\r
+ * This interface was modeled according to definition in <a\r
+ * href="https://tools.ietf.org/html/rfc6020#section-9.8">[RFC-6020] The binary\r
+ * Built-In Type</a>\r
+ * \r
  */\r
 public interface BinaryTypeDefinition extends\r
         TypeDefinition<BinaryTypeDefinition> {\r
 \r
     /**\r
      * Returns List of number of octets that binary value contains.\r
-     *\r
+     * \r
      * @return List of number of octets that binary value contains.\r
+     * \r
+     * @see LengthConstraint\r
      */\r
     public List<LengthConstraint> getLengthConstraints();\r
 }\r
index 92f3098a2371d27094d650684f4129e9943612f7..5b40c49f3e0fd2c8c964916acb94ecafa2c43958 100644 (file)
@@ -11,8 +11,30 @@ import java.util.List;
 \r
 import org.opendaylight.controller.yang.model.api.TypeDefinition;\r
 \r
+/**\r
+ * IntegerTypeDefinition is interface which represents SIGNED Integer values\r
+ * defined in Yang language. <br>\r
+ * The integer built-in types in Yang are int8, int16, int32, int64. They\r
+ * represent signed integers of different sizes: <br>\r
+ * <ul>\r
+ * <li>int8 represents integer values between -128 and 127, inclusively.</li>\r
+ * <li>int16 represents integer values between -32768 and 32767, inclusively.</li>\r
+ * <li>int32 represents integer values between -2147483648 and 2147483647,\r
+ * inclusively.</li>\r
+ * <li>int64 represents integer values between -9223372036854775808 and\r
+ * 9223372036854775807, inclusively.</li>\r
+ * </ul>\r
+ * \r
+ * The Integer Built-In Types are defined in <a\r
+ * href="https://tools.ietf.org/html/rfc6020#section-9.2"> [RFC-6020]</a>\r
+ */\r
 public interface IntegerTypeDefinition extends\r
         TypeDefinition<IntegerTypeDefinition> {\r
 \r
+    /**\r
+     * Returns Range Constraints defined for given Integer Type.\r
+     * \r
+     * @return Range Constraints defined for given Integer Type.\r
+     */\r
     List<RangeConstraint> getRangeStatements();\r
 }\r
index 8c9cb79ad06a059bdb75fc6a6b9f2267f112b4f0..97f4448f57cde5c347616aa90afd88342bd32139 100644 (file)
@@ -9,9 +9,42 @@ package org.opendaylight.controller.model.api.type;
 \r
 import org.opendaylight.controller.yang.model.api.ConstraintMetaDefinition;\r
 \r
+/**\r
+ * The Lenght Constraint value consists of an explicit value, or a lower bound\r
+ * returned by {@link #getMin()} and an upper bound returned by\r
+ * {@link #getMax()}. <br>\r
+ * <br>\r
+ * Length-restricting values MUST NOT be negative. A length value is a\r
+ * non-negative integer, or one of the special values <code>min</code> or\r
+ * <code>max</code>. The defined <code>min</code> and <code>max</code> mean the\r
+ * minimum and maximum length accepted for the type being restricted,\r
+ * respectively. <br>\r
+ * An implementation is not required to support a length value larger than\r
+ * {@link Long#MAX_VALUE} <br>\r
+ * <br>\r
+ * The interface extends definitions from {@link ConstraintMetaDefinition} <br>\r
+ * <br>\r
+ * This interface was modeled according to definition in <a\r
+ * href="https://tools.ietf.org/html/rfc6020#section-9.4.4">[RFC-6020] The\r
+ * length Statement</a>.\r
+ * \r
+ * @see ConstraintMetaDefinition\r
+ */\r
 public interface LengthConstraint extends ConstraintMetaDefinition {\r
 \r
+    /**\r
+     * Returns the length-restricting lower bound value. <br>\r
+     * The value MUST NOT be negative.\r
+     * \r
+     * @return the length-restricting lower bound value.\r
+     */\r
     Long getMin();\r
 \r
+    /**\r
+     * Returns the length-restricting upper bound value. <br>\r
+     * The value MUST NOT be negative.\r
+     * \r
+     * @return length-restricting upper bound value.\r
+     */\r
     Long getMax();\r
 }\r
index 76bfb75301d4358afcd1537fc1dbfec38d6a68d7..12fbb1bcd5728e3ee96b53fdaaa7a6c0384eac98 100644 (file)
@@ -9,9 +9,37 @@ package org.opendaylight.controller.model.api.type;
 \r
 import org.opendaylight.controller.yang.model.api.ConstraintMetaDefinition;\r
 \r
+/**\r
+ * The Range Constraint interface is used to restrict integer and decimal\r
+ * built-in types, or types derived from those.\r
+ * <br>\r
+ * A range consists of an explicit value consists of an explicit value, or a lower bound\r
+ * returned by {@link #getMin()} and an upper bound returned by\r
+ * {@link #getMax()}. <br>\r
+ * <br>\r
+ * Each explicit value and range boundary value given in\r
+ * the range expression MUST match the type being restricted, or be one of the\r
+ * special values "min" or "max". "min" and "max" mean the minimum and maximum\r
+ * value accepted for the type being restricted, respectively\r
+ * <br>\r
+ * <br>\r
+ * This interface was modeled according to definition in <a\r
+ * href="https://tools.ietf.org/html/rfc6020#section-9.2.4">[RFC-6020] The\r
+ * range Statement</a>.\r
+ */\r
 public interface RangeConstraint extends ConstraintMetaDefinition {\r
 \r
-    Long getMin();\r
+    /**\r
+     * Returns the length-restricting lower bound value.\r
+     * \r
+     * @return the length-restricting lower bound value.\r
+     */\r
+    Number getMin();\r
 \r
-    Long getMax();\r
+    /**\r
+     * Returns the length-restricting upper bound value.\r
+     * \r
+     * @return the length-restricting upper bound value.\r
+     */\r
+    Number getMax();\r
 }\r