org.jcoderz.commons.types.samples
Class TestEnumExpliciteValue

java.lang.Object
  extended by org.jcoderz.commons.types.samples.TestEnumExpliciteValue
All Implemented Interfaces:
Serializable, EnumType, StrongType

public final class TestEnumExpliciteValue
extends Object
implements Serializable, EnumType

Enumerated type of a test enum explicite value. Instances of this class are immutable. The following test enum explicite values are defined:

The values of this enum have beside the internal sequential integer representation that is used for serialization dedicated assigned numeric values that are used in the toInt() and fromInt() methods.

Author:
generated
See Also:
Serialized Form

Field Summary
static TestEnumExpliciteValue CLUBS
          The TestEnumExpliciteValue Clubs.
static int CLUBS_NUMERIC
          Numeric representation for TestEnumExpliciteValue Clubs.
static TestEnumExpliciteValue DIAMONDS
          The TestEnumExpliciteValue Diamonds.
static int DIAMONDS_NUMERIC
          Numeric representation for TestEnumExpliciteValue Diamonds.
static TestEnumExpliciteValue HEARTS
          The TestEnumExpliciteValue Hearts.
static int HEARTS_NUMERIC
          Numeric representation for TestEnumExpliciteValue Hearts.
static TestEnumExpliciteValue SPADES
          The TestEnumExpliciteValue Spades.
static int SPADES_NUMERIC
          Numeric representation for TestEnumExpliciteValue Spades.
static String TYPE_NAME
          The name of this type.
static Map VALUE_MAP
          Immutable map using the name string as key holding the TestEnumExpliciteValues as values.
static List VALUES
          Immutable list of the TestEnumExpliciteValues.
 
Method Summary
static TestEnumExpliciteValue fromInt(int i)
          Creates a TestEnumExpliciteValue object from its numeric representation.
static TestEnumExpliciteValue fromString(String str)
          Creates a TestEnumExpliciteValue object from its String representation.
 int toInt()
          Returns the int representation of this test enum explicite value.
 String toString()
          Returns the String representation of this test enum explicite value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_NAME

public static final String TYPE_NAME
The name of this type.

See Also:
Constant Field Values

CLUBS_NUMERIC

public static final int CLUBS_NUMERIC
Numeric representation for TestEnumExpliciteValue Clubs.

See Also:
Constant Field Values

CLUBS

public static final TestEnumExpliciteValue CLUBS
The TestEnumExpliciteValue Clubs.


DIAMONDS_NUMERIC

public static final int DIAMONDS_NUMERIC
Numeric representation for TestEnumExpliciteValue Diamonds.

See Also:
Constant Field Values

DIAMONDS

public static final TestEnumExpliciteValue DIAMONDS
The TestEnumExpliciteValue Diamonds.


HEARTS_NUMERIC

public static final int HEARTS_NUMERIC
Numeric representation for TestEnumExpliciteValue Hearts.

See Also:
Constant Field Values

HEARTS

public static final TestEnumExpliciteValue HEARTS
The TestEnumExpliciteValue Hearts.


SPADES_NUMERIC

public static final int SPADES_NUMERIC
Numeric representation for TestEnumExpliciteValue Spades.

See Also:
Constant Field Values

SPADES

public static final TestEnumExpliciteValue SPADES
The TestEnumExpliciteValue Spades.


VALUES

public static final List VALUES
Immutable list of the TestEnumExpliciteValues.


VALUE_MAP

public static final Map VALUE_MAP
Immutable map using the name string as key holding the TestEnumExpliciteValues as values.

Method Detail

fromInt

public static TestEnumExpliciteValue fromInt(int i)
                                      throws ArgumentMalformedException
Creates a TestEnumExpliciteValue object from its numeric representation.

Parameters:
i - the integer representation of the test enum explicite value.
Returns:
the TestEnumExpliciteValue object represented by this int.
Throws:
ArgumentMalformedException - If the assigned int value isn't listed in the internal test enum explicite value table.

fromString

public static TestEnumExpliciteValue fromString(String str)
                                         throws ArgumentMalformedException
Creates a TestEnumExpliciteValue object from its String representation.

Parameters:
str - the string representation of the test enum explicite value.
Returns:
the TestEnumExpliciteValue object represented by this str.
Throws:
ArgumentMalformedException - If the given str value isn't listed in the internal test enum explicite value table.

toInt

public int toInt()
Returns the int representation of this test enum explicite value.

Specified by:
toInt in interface EnumType
Returns:
the int representation of this test enum explicite value.

toString

public String toString()
Returns the String representation of this test enum explicite value.

Overrides:
toString in class Object
Returns:
the String representation of this test enum explicite value.


Copyright 2007 The jCoderZ Project.