*/\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