Interface Constant
public interface Constant
Interface Contact is designed to hold and model java constant. In Java there are no constant keywords instead of the
constant is defined as static final field with assigned value. For this purpose the Constant interface contains
methods
getType()
to provide wrapped return Type of Constant, getName()
the Name of constant and
the getValue()
for providing of value assigned to Constant. To determine of which type the constant value is
it is recommended firstly to retrieve Type from constant. The Type interface holds base information like java package
name and java type name (e.g. fully qualified name). From this string user should be able to determine to which type
can be getValue()
type typecasted to unbox and provide value assigned to constant.-
Method Summary
-
Method Details
-
getType
Type getType()Returns the return Type (or just Type) of the Constant.- Returns:
- the return Type (or just Type) of the Constant.
-
getName
String getName()Returns the name of constant.
By conventions the name SHOULD be in CAPITALS separated with underscores.- Returns:
- the name of constant.
-
getValue
Object getValue()Returns boxed value that is assigned for context.- Returns:
- boxed value that is assigned for context.
-