Android Utililty Methods Enum Get

List of utility methods to do Enum Get

Description

The list of methods to do Enum Get are organized into topic(s).

Method

ObjectgetPrivateEnum(Class klass, String enumName, String constantName)
get Private Enum
for (Class declaredClass : klass.getDeclaredClasses()) {
    if (declaredClass.getCanonicalName().equals(enumName)) {
        for (Object t : declaredClass.getEnumConstants()) {
            if (t.toString().equals(constantName)) {
                return t;
return null;
ObjectgetPrivateEnum(Class klass, String enumName, String constantName)
get Private Enum
for (Class declaredClass : klass.getDeclaredClasses()) {
    if (declaredClass.getCanonicalName().equals(enumName)) {
        for (Object t : declaredClass.getEnumConstants()) {
            if (t.toString().equals(constantName)) {
                return t;
return null;