org.x4juli.global.constants
Class ConstantCharacter

java.lang.Object
  extended byorg.x4juli.global.constants.ConstantCharacter
All Implemented Interfaces:
Constant, java.io.Serializable

public class ConstantCharacter
extends java.lang.Object
implements Constant

Constant super class for Character values.

Since:
0.5
Author:
Boris Unckel
See Also:
Serialized Form

Field Summary
private static java.util.Map CONSTANTS_MASTER_INDEX
          Holds the grand constants index map.
private static long serialVersionUID
           
private  java.lang.Character value
          Holds value of property value.
 
Fields inherited from interface org.x4juli.global.constants.Constant
ERR_DUP_NAME
 
Constructor Summary
protected ConstantCharacter(char value)
          Creates a new instance of ConstantObject.
protected ConstantCharacter(java.lang.Character value)
          Creates a new instance of ConstantObject.
 
Method Summary
 java.lang.Object getValue()
          Object way to access the value.
 java.lang.Character getValueAsObject()
          Getter for property value.
 char getValueAsPrimitive()
          Returns the value as primitive type.
 java.lang.String getValueAsString()
          Return the plain value as String. getValueAsString differs from toString():
getValueAsString is just the plain value without technical content.
 java.lang.Class getValueType()
          Determine the type.
static java.util.Map lookup(java.lang.Class dataType)
          Get the constants index for the given class.
static ConstantCharacter lookup(java.lang.Class dataType, char value)
          Get the constant for the given class and id.
static ConstantCharacter lookup(java.lang.Class dataType, java.lang.Character value)
          Get the constant for the given class and id.
protected  java.lang.Object readResolve()
          Resolve a read in object.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

CONSTANTS_MASTER_INDEX

private static final java.util.Map CONSTANTS_MASTER_INDEX
Holds the grand constants index map. Contains references to all constants indexes that are instantiated indexed by constant value.


value

private final java.lang.Character value
Holds value of property value.

Constructor Detail

ConstantCharacter

protected ConstantCharacter(java.lang.Character value)
Creates a new instance of ConstantObject.

Parameters:
value - The value for the constant object.
Throws:
java.lang.NullPointerException - If null is given for the constant value.
java.lang.IllegalArgumentException - If the user passes a null value.
Since:
0.5

ConstantCharacter

protected ConstantCharacter(char value)
Creates a new instance of ConstantObject.

Parameters:
value - The value for the constant object.
Throws:
java.lang.IllegalArgumentException - If the user passes a null value.
Since:
0.5
Method Detail

lookup

public static final ConstantCharacter lookup(java.lang.Class dataType,
                                             java.lang.Character value)
Get the constant for the given class and id.

Parameters:
dataType - The class for which to retrieve the index.
value - The value of the constant.
Returns:
The constant object for the given class and value.
Since:
0.5

lookup

public static final ConstantCharacter lookup(java.lang.Class dataType,
                                             char value)
Get the constant for the given class and id.

Parameters:
dataType - The class for which to retrieve the index.
value - The value of the constant.
Returns:
The constant object for the given class and value.
Since:
0.5

lookup

public static final java.util.Map lookup(java.lang.Class dataType)
Get the constants index for the given class.

Parameters:
dataType - The class for which to retrieve the index.
Returns:
An unmodifiable map of constants for the given class.

getValueType

public final java.lang.Class getValueType()
Determine the type.

Specified by:
getValueType in interface Constant
Returns:
the type of the constant as Class
Since:
0.5

getValue

public final java.lang.Object getValue()
Object way to access the value.

Specified by:
getValue in interface Constant
Returns:
the value of the constant as java.lang.Object
Since:
0.5

getValueAsString

public final java.lang.String getValueAsString()
Return the plain value as String. getValueAsString differs from toString():
getValueAsString is just the plain value without technical content.

Specified by:
getValueAsString in interface Constant
Returns:
the value of the constant as java.lang.String
Since:
0.5

getValueAsPrimitive

public final char getValueAsPrimitive()
Returns the value as primitive type.

Returns:
primitive value.
Since:
0.5

getValueAsObject

public final java.lang.Character getValueAsObject()
Getter for property value.

Returns:
Value of property value.
Since:
0.5

toString

public java.lang.String toString()

Since:
0.5

readResolve

protected java.lang.Object readResolve()
                                throws java.io.ObjectStreamException
Resolve a read in object.

Returns:
The resolved object read in.
Throws:
java.io.ObjectStreamException - if there is a problem reading the object.
java.lang.RuntimeException - If the read object doesnt exist.
Since:
0.5


${license_html}