code: protected static Object convertBasicValue(String value, Class<?> type) {
          if (type == null) {
              throw new IllegalArgumentException("Type cannot be null");
          }
  
          if (String.class.equals(type)) {
              return value;
          }
  
          if (value == null || value.trim().isEmpty()) {
              return null;
          }
  
          try {
              value = value.trim();
              if (Byte.class.equals(type)) {
                  return Byte.parseByte(value);
              } else if (Short.class.equals(type)) {
                  return Short.parseShort(value);
              } else if (Integer.class.equals(type)) {
                  return Integer.parseInt(value);
              } else if (Long.class.equals(type)) {
                  return Long.parseLong(value);
              } else if (BigInteger.class.equals(type)) {
                  return new BigInteger(value);
              } else if (Float.class.equals(type)) {
                  return Float.parseFloat(value);
              } else if (Double.class.equals(type)) {
                  return Double.parseDouble(value);
              } else if (BigDecimal.class.equals(type)) {
                  return new BigDecimal(value);
              } else if (Boolean.class.equals(type)) {
                  return Boolean.parseBoolean(value);
              }
          } catch (Exception e) {
              throw new UniformException(String.format("Error while converting value %s to data type %s. Make sure the element has correct values and/or validators", value, type.getName()), e);
          }
  
          throw new UnsupportedOperationException("Could not convert value to unknown type: " + type.getName());
      }
docs: Converts a basic value to the given basic type (numeric and simple types), if possible. If conversion is not possible, an exception will be thrown.
  
  @param value Input value
  @param type Target type
  @return Converted value