public final RequestCacheControl parseRequest(final Iterator<Header> headerIterator) {
        Args.notNull(headerIterator, "headerIterator");
        final RequestCacheControl.Builder builder = RequestCacheControl.builder();
        parse(headerIterator, (name, value) -> {
            if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_MAX_AGE)) {
                builder.setMaxAge(parseSeconds(name, value));
            } else if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_MAX_STALE)) {
                builder.setMaxStale(parseSeconds(name, value));
            } else if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_MIN_FRESH)) {
                builder.setMinFresh(parseSeconds(name, value));
            } else if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_NO_STORE)) {
                builder.setNoStore(true);
            } else if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_NO_CACHE)) {
                builder.setNoCache(true);
            } else if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_ONLY_IF_CACHED)) {
                builder.setOnlyIfCached(true);
            } else if (name.equalsIgnoreCase(HeaderConstants.CACHE_CONTROL_STALE_IF_ERROR)) {
                builder.setStaleIfError(parseSeconds(name, value));
            }
        });
        return builder.build();
    }
Parses the specified request header and returns a new {@link RequestCacheControl} instance containing
the relevant caching directives.

@param headerIterator the header to parse, cannot be {@code null}
@return a new {@link RequestCacheControl} instance containing the relevant caching directives parsed
from the request header
@throws IllegalArgumentException if the input header is {@code null}
httpclient5-cache/src/main/java/org/apache/hc/client5/http/impl/cache/CacheControlHeaderParser.java