Interface ParsedHeaderValues


  • public interface ParsedHeaderValues
    A container with the request's headers that are meaningful enough to be parsed Contains:
    • Accept -> MIME header, parameters and sortable
    • Accept-Charset -> Parameters and sortable
    • Accept-Encoding -> Parameters and sortable
    • Accept-Language -> Parameters and sortable
    • Content-Type -> MIME header and parameters
    • Method Detail

      • accept

        List<MIMEHeader> accept()
        Returns:
        List of MIME values in the Accept header
      • acceptCharset

        List<ParsedHeaderValue> acceptCharset()
        Returns:
        List of charset values in the Accept-Charset header
      • acceptEncoding

        List<ParsedHeaderValue> acceptEncoding()
        Returns:
        List of encofing values in the Accept-Encoding header
      • acceptLanguage

        List<LanguageHeader> acceptLanguage()
        Returns:
        List of languages in the Accept-Language header
      • contentType

        MIMEHeader contentType()
        Returns:
        MIME value in the Content-Type header
      • findBestUserAcceptedIn

        MIMEHeader findBestUserAcceptedIn​(List<MIMEHeader> accepted,
                                          Collection<MIMEHeader> in)
        Given the sorted list of parsed header values the user has sent and an Iterable of acceptable values: It finds the first accepted header that matches any inside the Iterable.

        Note: This method is intended for internal usage.

        Parameters:
        accepted - The sorted list of headers to find the best one.
        in - The headers to match against.
        Returns:
        The first header that matched, otherwise empty if none matched