org.x4juli.global.constants
Class ConstantLong

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

public class ConstantLong
extends java.lang.Object
implements Constant

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

Constructor Detail

ConstantLong

protected ConstantLong(java.lang.Long 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

ConstantLong

protected ConstantLong(long key)
Creates a new instance of ConstantObject.

Parameters:
key - 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 ConstantLong lookup(java.lang.Class dataType,
                                        java.lang.Long key)
Get the constant for the given class and id.

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

lookup

public static final ConstantLong lookup(java.lang.Class dataType,
                                        long 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.
Since:
0.5

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

Returns:
primitive value.
Since:
0.5

getValueAsObject

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