org.x4juli.global.constants
Class ConstantByte

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

public class ConstantByte
extends java.lang.Object
implements Constant

Constant super class for Byte 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
          Use serialVersionUID for interoperability.
private  java.lang.Byte value
          Holds value of property value.
 
Fields inherited from interface org.x4juli.global.constants.Constant
ERR_DUP_NAME
 
Constructor Summary
protected ConstantByte(byte value)
          Creates a new instance of ConstantObject.
protected ConstantByte(java.lang.Byte value)
          Creates a new instance of ConstantObject.
 
Method Summary
 java.lang.Object getValue()
          Object way to access the value.
 java.lang.Byte getValueAsObject()
          Getter for property value.
 byte 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 ConstantByte lookup(java.lang.Class dataType, byte value)
          Get the constant for the given class and id.
static ConstantByte lookup(java.lang.Class dataType, java.lang.Byte 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

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.


serialVersionUID

private static final long serialVersionUID
Use serialVersionUID for interoperability.

See Also:
Constant Field Values

value

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

Constructor Detail

ConstantByte

protected ConstantByte(java.lang.Byte 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.

ConstantByte

protected ConstantByte(byte 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.
Method Detail

lookup

public static final ConstantByte lookup(java.lang.Class dataType,
                                        java.lang.Byte 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.

lookup

public static final ConstantByte lookup(java.lang.Class dataType,
                                        byte 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.

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 byte getValueAsPrimitive()
Returns the value as primitive type.

Returns:
primitive value.
Since:
0.5

getValueAsObject

public final java.lang.Byte 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}