code: private static Converter<List<String>, Object> createStringMethodConverter(Class<?> resultClass) {
      // A special case for Character type, as it doesn't have a valueOf(String) method
      if (resultClass == Character.class) {
        return new BasicConverter(defaultValue(resultClass)) {
          @Nullable
          @Override
          Object convert(String value) throws Exception {
            return value.length() >= 1 ? value.charAt(0) : null;
          }
        };
      }
  
  
      Method method;
      try {
        method = resultClass.getMethod("valueOf", String.class);
      } catch (Exception e) {
        try {
          method = resultClass.getMethod("fromString", String.class);
        } catch (Exception ex) {
          return null;
        }
      }
  
      final Method convertMethod = method;
      return new BasicConverter(defaultValue(resultClass)) {
        @Override
        protected Object convert(String value) throws Exception {
          return convertMethod.invoke(null, value);
        }
      };
    }
docs: Creates a converter function that converts value using a public static method named
  {@code valueOf} or {@code fromString} that accepts a single String argument.
  
  @return A converter function or {@code null} if the given type doesn't have a public static method
  named {@code valueOf} or {@code fromString} that accepts a single String argument.