code: public static <T extends Enum<T>> T valueOf(Class<T> enumType,
                                                  String name) {
          // Android-changed: Use a static BasicLruCache mapping Enum class -> Enum instance array.
          if (enumType == null) {
              throw new NullPointerException("enumType == null");
          }
          if (name == null) {
              throw new NullPointerException("name == null");
          }
          T[] values = getSharedConstants(enumType);
          if (values == null) {
              throw new IllegalArgumentException(enumType.toString() + " is not an enum type.");
          }
  
          // Iterate backwards through the array to retain historic Android behavior in the
          // unexpected / likely invalid case where there are multiple values with the same name.
          for (int i = values.length - 1; i >= 0; --i) {
              T value = values[i];
              if (name.equals(value.name())) {
                  return value;
              }
          }
          throw new IllegalArgumentException(
                  "No enum constant " + enumType.getCanonicalName() + "." + name);
      }
docs: Returns the enum constant of the specified enum type with the
  specified name.  The name must match exactly an identifier used
  to declare an enum constant in this type.  (Extraneous whitespace
  characters are not permitted.)
  
  <p>Note that for a particular enum type {@code T}, the
  implicitly declared {@code public static T valueOf(String)}
  method on that enum may be used instead of this method to map
  from a name to the corresponding enum constant.  All the
  constants of an enum type can be obtained by calling the
  implicit {@code public static T[] values()} method of that
  type.
  
  @param <T> The enum type whose constant is to be returned
  @param enumType the {@code Class} object of the enum type from which
  to return a constant
  @param name the name of the constant to return
  @return the enum constant of the specified enum type with the
  specified name
  @throws IllegalArgumentException if the specified enum type has
  no constant with the specified name, or the specified
  class object does not represent an enum type
  @throws NullPointerException if {@code enumType} or {@code name}
  is null
  @since 1.5