private static <T extends Enum<T>> String parseEnumValue(Object value, T defaultValue) {
    if (value instanceof String) {
      String name = Strings.toUpperCase((String)value);
      //noinspection unchecked
      for (T t : ((Class<T>)defaultValue.getClass()).getEnumConstants()) {
        if (t.name().equals(name)) {
          return Strings.toLowerCase(value.toString());
        }
      }
    }
    return Strings.toLowerCase(defaultValue.name());
  }
private static <T extends Enum<T>> String parseEnumValue(Object value, T defaultValue)