public T map(T record) {
        if (record == null) {
            return null;
        }
        if (mapper == null) {
            throw new InvalidParserConfigurationException("[Map] The mapper instance is null.");
        }

        UserAgent userAgent = userAgentAnalyzer.parse(mapper.getRequestHeaders(record));

        for (Map.Entry<String, List<Method>> fieldSetter : fieldSetters.entrySet()) {
            String value = userAgent.getValue(fieldSetter.getKey());
            for (Method method : fieldSetter.getValue()) {
                try {
                    method.invoke(mapper, record, value);
                } catch (IllegalAccessException | InvocationTargetException e) {
                    throw new InvalidParserConfigurationException("A problem occurred while calling the requested setter", e);
                }
            }
        }
        return record;
    }
Sets the new size of the parsing cache.
Note that this will also wipe the existing cache.

@param newCacheSize The size of the new LRU cache. As size of 0 will disable caching.
analyzer/src/main/java/nl/basjes/parse/useragent/annotate/UserAgentAnnotationAnalyzer.java