BUG-6533: add immutable implementations of yang.model.api
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / type / EnumTypeDefinition.java
index c52523f14554bbd09e8e23e14c9f1ab37be13f92..402d7135d9f8eb5be3ea0766d2873fddcf196e65 100644 (file)
@@ -8,31 +8,43 @@
 package org.opendaylight.yangtools.yang.model.api.type;
 
 import java.util.List;
-
-import org.opendaylight.yangtools.yang.model.api.SchemaNode;
+import javax.annotation.Nonnull;
+import org.opendaylight.yangtools.yang.model.api.DocumentedNode;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 
+/**
+ * Makes is possible to access to the individual enumeration values of this
+ * type.
+ */
 public interface EnumTypeDefinition extends TypeDefinition<EnumTypeDefinition> {
+    /**
+     * Returns all enumeration values.
+     *
+     * @return list of <code>EnumPair</code> type instastances which contain the
+     *         data about all individual enumeration pairs of
+     *         <code>enumeration</code> YANG built-in type
+     */
+    @Nonnull List<EnumPair> getValues();
 
-    List<EnumPair> getValues();
-
-    interface EnumPair extends SchemaNode {
-
+    /**
+     * Contains the methods for accessing the data about the concrete
+     * enumeration item which represents <code>enum</code> YANG type.
+     */
+    interface EnumPair extends DocumentedNode.WithStatus {
         /**
          * The name to specify each assigned name of an enumeration type.
          *
          * @return name of each assigned name of an enumeration type.
          */
-        public String getName();
+        String getName();
 
         /**
          * The "value" statement, which is optional, is used to associate an
          * integer value with the assigned name for the enum. This integer value
-         * MUST be in the range -2147483648 to 2147483647, and it MUST be unique
-         * within the enumeration type.
+         * MUST be unique within the enumeration type.
          *
          * @return integer value assigned to enumeration
          */
-        public Integer getValue();
+        int getValue();
     }
 }