code: protected <T> T convertIfNecessary(String value, T originalValue) {
          if (originalValue == null) {
              return (T) value;
          }
  
          return TypeConversionUtils.convertIfNecessary(value, (Class<T>) originalValue.getClass());
      }
docs: Convert to original value type if necessary.
  @param value
  @param originalValue
  @param <T>
  @return