Extended binding-model-api to support of Enclosed Generated Types and TOs.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / binding-model-api / src / main / java / org / opendaylight / controller / sal / binding / model / api / Constant.java
index cad3460913d3d178759936dd67a9ea6c29a445e9..921a4733410a0a32e93de193f24245abeaa82682 100644 (file)
@@ -7,15 +7,61 @@
  */\r
 package org.opendaylight.controller.sal.binding.model.api;\r
 \r
+/**\r
+ * Interface Contact is designed to hold and model java constant. In Java\r
+ * there are no constant keywords instead of the constant is defined as\r
+ * static final field with assigned value. For this purpose the Constant\r
+ * interface contains methods {@link #getType()} to provide wrapped return\r
+ * Type of Constant, {@link #getName()} the Name of constant and the {@link\r
+ * #getValue()} for providing of value assigned to Constant. To determine of\r
+ * which type the constant value is it is recommended firstly to retrieve\r
+ * Type from constant. The Type interface holds base information like java\r
+ * package name and java type name (e.g. fully qualified name). From this\r
+ * string user should be able to determine to which type can be {@link\r
+ * #getValue()} type typecasted to unbox and provide value assigned to\r
+ * constant.\r
+ */\r
 public interface Constant {\r
 \r
+    /**\r
+     * Returns the Type that declares constant.\r
+     *\r
+     * @return the Type that declares constant.\r
+     */\r
     public Type getDefiningType();\r
 \r
+    /**\r
+     * Returns the return Type (or just Type) of the Constant.\r
+     *\r
+     * @return the return Type (or just Type) of the Constant.\r
+     */\r
     public Type getType();\r
 \r
+    /**\r
+     * Returns the name of constant.\r
+     * <br>\r
+     * By conventions the name SHOULD be in CAPITALS separated with\r
+     * underscores.\r
+     *\r
+     * @return the name of constant.\r
+     */\r
     public String getName();\r
 \r
+    /**\r
+     * Returns boxed value that is assigned for context.\r
+     *\r
+     * @return boxed value that is assigned for context.\r
+     */\r
     public Object getValue();\r
 \r
+    /**\r
+     * Returns Constant definition in formatted string.\r
+     * <br>\r
+     * <br>\r
+     * The expected string SHOULD be in format: <code>public final\r
+     * static [Type] CONSTANT_NAME = [value];</code>\r
+     *\r
+     * @return Constant definition in formatted string.\r
+     */\r
     public String toFormattedString();\r
 }\r