|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jcoderz.commons.types.samples.TestEnumAsNumeric
public final class TestEnumAsNumeric
Enumerated type of a test enum as numeric. Instances of this class are immutable. The following test enum as numerics are defined:
| 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 |
|---|
public static final String TYPE_NAME
public static final TestEnumAsNumeric CLUBS
public static final TestEnumAsNumeric DIAMONDS
public static final TestEnumAsNumeric HEARTS
public static final TestEnumAsNumeric SPADES
public static final List VALUES
public static final Map VALUE_MAP
| Method Detail |
|---|
public static TestEnumAsNumeric fromInt(int i)
throws ArgumentMalformedException
i - the integer representation of the test enum as numeric.
ArgumentMalformedException - If the assigned int value isn't
listed in the internal test enum as numeric table.
public static TestEnumAsNumeric fromString(String str)
throws ArgumentMalformedException
str - the string representation of the
test enum as numeric.
ArgumentMalformedException - If the given str value isn't
listed in the internal test enum as numeric 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 | |||||||||