org.jcoderz.commons.types.samples
Class TestRoles

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

public final class TestRoles
extends Object
implements Serializable, EnumType

Enumerated type of a test roles. Instances of this class are immutable. The following test roless 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 TestRoles FOO_R10021
          Experts (value: FOO.R10021).
static TestRoles FOO_R10022
          Guests (value: FOO.R10022).
static String TYPE_NAME
          The name of this type.
static Map VALUE_MAP
          Immutable map using the name string as key holding the TestRoless as values.
static List VALUES
          Immutable list of the TestRoless.
 
Method Summary
static TestRoles fromInt(int i)
          Creates a TestRoles object from its int representation.
static TestRoles fromString(String str)
          Creates a TestRoles object from its String representation.
 int toInt()
          Returns the int representation of this test roles.
 String toString()
          Returns the String representation of this test roles.
 
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

FOO_R10021

public static final TestRoles FOO_R10021
Experts (value: FOO.R10021).


FOO_R10022

public static final TestRoles FOO_R10022
Guests (value: FOO.R10022).


VALUES

public static final List VALUES
Immutable list of the TestRoless.


VALUE_MAP

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

Method Detail

fromInt

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

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

fromString

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

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

toInt

public int toInt()
Returns the int representation of this test roles.

Specified by:
toInt in interface EnumType
Returns:
the int representation of this test roles.

toString

public String toString()
Returns the String representation of this test roles.

Overrides:
toString in class Object
Returns:
the String representation of this test roles.


Copyright 2007 The jCoderZ Project.