org.jcoderz.commons.types.samples
Class TestEnumAsNumeric

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

public final class TestEnumAsNumeric
extends Object
implements Serializable, EnumType

Enumerated type of a test enum as numeric. Instances of this class are immutable. The following test enum as numerics are defined:

The values of this enum have a internal sequential integer representation starting with '0'.

Author:
generated
See Also:
Serialized Form

Field Summary
static TestEnumAsNumeric CLUBS
          The TestEnumAsNumeric Clubs.
static TestEnumAsNumeric DIAMONDS
          The TestEnumAsNumeric Diamonds.
static TestEnumAsNumeric HEARTS
          The TestEnumAsNumeric Hearts.
static TestEnumAsNumeric SPADES
          The TestEnumAsNumeric Spades.
static String TYPE_NAME
          The name of this type.
static Map VALUE_MAP
          Immutable map using the name string as key holding the TestEnumAsNumerics as values.
static List VALUES
          Immutable list of the TestEnumAsNumerics.
 
Method Summary
static TestEnumAsNumeric fromInt(int i)
          Creates a TestEnumAsNumeric object from its int representation.
static TestEnumAsNumeric fromString(String str)
          Creates a TestEnumAsNumeric object from its String representation.
 int toInt()
          Returns the int representation of this test enum as numeric.
 String toString()
          Returns the String representation of this test enum as numeric.
 
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

public static final TestEnumAsNumeric CLUBS
The TestEnumAsNumeric Clubs.


DIAMONDS

public static final TestEnumAsNumeric DIAMONDS
The TestEnumAsNumeric Diamonds.


HEARTS

public static final TestEnumAsNumeric HEARTS
The TestEnumAsNumeric Hearts.


SPADES

public static final TestEnumAsNumeric SPADES
The TestEnumAsNumeric Spades.


VALUES

public static final List VALUES
Immutable list of the TestEnumAsNumerics.


VALUE_MAP

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

Method Detail

fromInt

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

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

fromString

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

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

toInt

public int toInt()
Returns the int representation of this test enum as numeric.

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

toString

public String toString()
Returns the String representation of this test enum as numeric.

Overrides:
toString in class Object
Returns:
the String representation of this test enum as numeric.


Copyright 2007 The jCoderZ Project.