private static Object toFieldValue(Field field, String valueString) {
        if (field == null) {
            throw new IllegalArgumentException("Field not defined");
        }

        if (field.getAnnotation(ParameterConverter.class) != null) {
            Class<? extends ConfigurationParameterConverter<?>> converterClass = field.getAnnotation(ParameterConverter.class).value();

            try {
                ConfigurationParameterConverter<?> converter = converterClass.getDeclaredConstructor().newInstance();
                if (converter.getType().isAssignableFrom(field.getType())) {
                    return converter.convert(valueString);
                }
            } catch (InstantiationException | IllegalAccessException | InvocationTargetException |
                     NoSuchMethodException e) {
                throw new IllegalArgumentException("Could not initialize parameter converter", e);
            }
            throw new IllegalArgumentException("Unsupported field type " + field.getType() + " for converter " + converterClass);
        }

        if (field.getType() == String.class) {
            return valueString;
        }
        if ((field.getType() == boolean.class) || (field.getType() == Boolean.class)) {
            return Boolean.parseBoolean(valueString);
        }
        if ((field.getType() == byte.class) || (field.getType() == Byte.class)) {
            return Byte.parseByte(valueString);
        }
        if ((field.getType() == short.class) || (field.getType() == Short.class)) {
            return Short.parseShort(valueString);
        }
        if ((field.getType() == int.class) || (field.getType() == Integer.class)) {
            return Integer.parseInt(valueString);
        }
        if ((field.getType() == long.class) || (field.getType() == Long.class)) {
            return Long.parseLong(valueString);
        }
        if ((field.getType() == float.class) || (field.getType() == Float.class)) {
            return Float.parseFloat(valueString);
        }
        if ((field.getType() == double.class) || (field.getType() == Double.class)) {
            return Double.parseDouble(valueString);
        }
        if (field.getType().isEnum()) {
            return parseEnumValue(field, valueString);
        }
        throw new IllegalArgumentException("Unsupported property type " + field.getType().getName());
    }
Convert the string value from the parameter string into the type the field requires.

@param field       field that should be set
@param valueString string representation of the value
@return parsed value of the field in the type the field requires
plc4j/spi/src/main/java/org/apache/plc4x/java/spi/configuration/ConfigurationFactory.java