|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.beanlib.utils.EnumUtils
public class EnumUtils
Enum Utilities.
Nested Class Summary | |
---|---|
private static class |
EnumUtils.LazyExternal
Contains a lazily initialized internal map used for implementing fromExternal(). |
private static class |
EnumUtils.LazyOrdinal
Contains a lazily initialized internal map used for implementing fromOrdinal(). |
private static class |
EnumUtils.LazyToString
Contains a lazily initialized internal map used for implementing fromString(). |
Constructor Summary | |
---|---|
private |
EnumUtils()
|
Method Summary | ||
---|---|---|
private static
|
enumConstantDirectory(Class<T> enumType)
Returns a map from the externalized object of type E to enum constant for the specified T, which has a type of both Enum and External. |
|
private static
|
enumOrdinalConstantDirectory(Class<T> enumType)
Returns a map from the ordinal() return value to the enum constant for the specified T, which is an Enum. |
|
private static
|
enumStringConstantDirectory(Class<T> enumType)
Returns a map from the toString() return value to the enum constant for the specified T, which is an Enum. |
|
static
|
fromExternal(Class<T> enumType,
E externalized)
Returns the enum constant of the specified Enum and External type with the specified externalized object; or null if no such enum constant exists. |
|
static
|
fromOrdinal(Class<T> enumType,
int ordinal)
Returns the enum constant of the specified Enum with the specified ordinal() return value of the enum constant; or null if no such enum constant exists. |
|
static
|
fromString(Class<T> enumType,
String s)
Returns the enum constant of the specified Enum with the specified toString() return value of the enum constant; or null if no such enum constant exists. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
private EnumUtils()
Method Detail |
---|
public static <T extends Enum<T> & External<E>,E> T fromExternal(Class<T> enumType, E externalized)
public static <T extends Enum<T>> T fromString(Class<T> enumType, String s)
public static <T extends Enum<T>> T fromOrdinal(Class<T> enumType, int ordinal)
private static <T extends Enum<T> & External<E>,E> Map<E,T> enumConstantDirectory(Class<T> enumType)
public static <T extends Enum<T> & External<E>> T fromExternal(Class<T>, E)efficiently. Note that the map returned by this method is created lazily on first use. Typically it won't ever get created.
private static <T extends Enum<T>> Map<String,T> enumStringConstantDirectory(Class<T> enumType)
public static <T extends Enum<T>> T fromString(Class<T>, String)efficiently. Note that the map returned by this method is created lazily on first use. Typically it won't ever get created.
private static <T extends Enum<T>> Map<Integer,T> enumOrdinalConstantDirectory(Class<T> enumType)
public static <T extends Enum<T>> T fromOrdinal(Class<T>, int)efficiently. Note that the map returned by this method is created lazily on first use. Typically it won't ever get created.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |