code: private static Object valueOf(final String value, final Class<?> objectType) {
  
          if (objectType == Character.class) {
              return value.charAt(0);
          }
  
          try {
              final Constructor<?> constructor = objectType.getConstructor(String.class);
              return constructor.newInstance(value);
          } catch (InstantiationException | InvocationTargetException | NoSuchMethodException | IllegalAccessException e) {
              //this should never happen
              throw new RuntimeException( //NOSONAR
                                          "Could not create instance of type "
                                                  + objectType.getName()
                                                  + " from value "
                                                  + value, e);
          }
      }
docs: Converts the given String value to a object type. The method assumes the object type has a constructor accepting
  a single String representation of the content.
  
  @param objectType
  the object type that MUST have a single String constructor, which is the case for any any primitive
  type.
  @param value
  the value as a string to be converted
  
  @return the converted value
  
  @throws RuntimeException
  if the object type has no valueOf method or the method can not be invoked.