private static void tryToSetPrimitive(Object object, SetterClassPair setterClassPair,
                                          String value) throws TikaConfigException {
        try {
            if (setterClassPair.itemClass == int.class) {
                setterClassPair.setterMethod.invoke(object, Integer.parseInt(value));
            } else if (setterClassPair.itemClass == long.class) {
                setterClassPair.setterMethod.invoke(object, Long.parseLong(value));
            } else if (setterClassPair.itemClass == float.class) {
                setterClassPair.setterMethod.invoke(object, Float.parseFloat(value));
            } else if (setterClassPair.itemClass == double.class) {
                setterClassPair.setterMethod.invoke(object, Double.parseDouble(value));
            } else if (setterClassPair.itemClass == boolean.class) {
                setterClassPair.setterMethod.invoke(object, Boolean.parseBoolean(value));
            } else {
                setterClassPair.setterMethod.invoke(object, value);
            }
        } catch (IllegalAccessException | InvocationTargetException e) {
            throw new TikaConfigException("bad parameter " + setterClassPair + " " + value, e);
        }
    }
Use this to build a list of components for a composite item (e.g.
CompositeMetadataFilter, FetcherManager), each with their own configurations

@param compositeElementName
@param itemName
@param is
@throws TikaConfigException
@throws IOException
tika-core/src/main/java/org/apache/tika/config/ConfigBase.java