@Override
  public E read(JsonReader reader) throws IOException {
    if (reader.peek() == JsonToken.NULL) {
      reader.nextNull();
      return null;
    }
    String value = reader.nextString();
    try {
      return Enum.valueOf(clazz, value.toUpperCase(Locale.ENGLISH));
    } catch (IllegalArgumentException iae) {
      LOG.warn("Unknown type for enum {}: '{}'", clazz.getName(), value);
      return unknownValue;
    }
  }
@param unknownValue the value to return if the value cannot be found.
src/main/java/com/google/maps/internal/SafeEnumAdapter.java