|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jcoderz.commons.types.samples.TestEnum
public final class TestEnum
Enumerated type of a test enum. Instances of this class are immutable. The following test enums are defined:
| Field Summary | |
|---|---|
static TestEnum |
CLUBS
The TestEnum Clubs. |
static TestEnum |
DIAMONDS
The TestEnum Diamonds. |
static TestEnum |
HEARTS
The TestEnum Hearts. |
static TestEnum |
SPADES
The TestEnum Spades. |
static String |
TYPE_NAME
The name of this type. |
static Map |
VALUE_MAP
Immutable map using the name string as key holding the TestEnums as values. |
static List |
VALUES
Immutable list of the TestEnums. |
| Method Summary | |
|---|---|
static TestEnum |
fromInt(int i)
Creates a TestEnum object from its int representation. |
static TestEnum |
fromString(String str)
Creates a TestEnum object from its String representation. |
int |
toInt()
Returns the int representation of this test enum. |
String |
toString()
Returns the String representation of this test enum. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String TYPE_NAME
public static final TestEnum CLUBS
public static final TestEnum DIAMONDS
public static final TestEnum HEARTS
public static final TestEnum SPADES
public static final List VALUES
public static final Map VALUE_MAP
| Method Detail |
|---|
public static TestEnum fromInt(int i)
throws ArgumentMalformedException
i - the integer representation of the test enum.
ArgumentMalformedException - If the assigned int value isn't
listed in the internal test enum table.
public static TestEnum fromString(String str)
throws ArgumentMalformedException
str - the string representation of the
test enum.
ArgumentMalformedException - If the given str value isn't
listed in the internal test enum table.public int toInt()
toInt in interface EnumTypepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||