Interface HttpFields

    • Method Detail

      • asString

        default java.lang.String asString()
      • contains

        default boolean contains​(HttpField field)
      • contains

        default boolean contains​(HttpHeader header,
                                 java.lang.String value)
      • contains

        default boolean contains​(java.lang.String name,
                                 java.lang.String value)
      • contains

        default boolean contains​(HttpHeader header)
      • contains

        default boolean contains​(java.util.EnumSet<HttpHeader> headers)
      • contains

        default boolean contains​(java.lang.String name)
      • get

        default java.lang.String get​(HttpHeader header)
      • get

        default java.lang.String get​(java.lang.String header)
      • getCSV

        default java.util.List<java.lang.String> getCSV​(HttpHeader header,
                                                        boolean keepQuotes)
        Get multiple field values of the same name, split as a QuotedCSV
        Parameters:
        header - The header
        keepQuotes - True if the fields are kept quoted
        Returns:
        List the values with OWS stripped
      • getCSV

        default java.util.List<java.lang.String> getCSV​(java.lang.String name,
                                                        boolean keepQuotes)
        Get multiple field values of the same name as a QuotedCSV
        Parameters:
        name - the case-insensitive field name
        keepQuotes - True if the fields are kept quoted
        Returns:
        List the values with OWS stripped
      • getDateField

        default long getDateField​(java.lang.String name)
        Get a header as a date value. Returns the value of a date field, or -1 if not found. The case of the field name is ignored.
        Parameters:
        name - the case-insensitive field name
        Returns:
        the value of the field as a number of milliseconds since unix epoch
      • getField

        HttpField getField​(int index)
        Get a Field by index.
        Parameters:
        index - the field index
        Returns:
        A Field value or null if the Field value has not been set
      • getField

        default HttpField getField​(java.lang.String name)
      • getFieldNames

        default java.util.Enumeration<java.lang.String> getFieldNames()
        Get enumeration of header _names. Returns an enumeration of strings representing the header _names for this request.
        Returns:
        an enumeration of field names
      • getFieldNamesCollection

        default java.util.Set<java.lang.String> getFieldNamesCollection()
        Get Set of header names.
        Returns:
        the unique set of field names.
      • getFields

        default java.util.List<HttpField> getFields​(HttpHeader header)
        Get multiple fields of the same header
        Parameters:
        header - the header
        Returns:
        List the fields
      • getFields

        default java.util.List<HttpField> getFields​(java.lang.String name)
      • getLongField

        default long getLongField​(java.lang.String name)
                           throws java.lang.NumberFormatException
        Get a header as an long value. Returns the value of an integer field or -1 if not found. The case of the field name is ignored.
        Parameters:
        name - the case-insensitive field name
        Returns:
        the value of the field as a long
        Throws:
        java.lang.NumberFormatException - If bad long found
      • getLongField

        default long getLongField​(HttpHeader header)
                           throws java.lang.NumberFormatException
        Get a header as an long value. Returns the value of an integer field or -1 if not found. The case of the field name is ignored.
        Parameters:
        header - the header type
        Returns:
        the value of the field as a long
        Throws:
        java.lang.NumberFormatException - If bad long found
      • getQualityCSV

        default java.util.List<java.lang.String> getQualityCSV​(HttpHeader header)
        Get multiple field values of the same name, split and sorted as a QuotedQualityCSV
        Parameters:
        header - The header
        Returns:
        List the values in quality order with the q param and OWS stripped
      • getQualityCSV

        default java.util.List<java.lang.String> getQualityCSV​(HttpHeader header,
                                                               java.util.function.ToIntFunction<java.lang.String> secondaryOrdering)
        Get multiple field values of the same name, split and sorted as a QuotedQualityCSV
        Parameters:
        header - The header
        secondaryOrdering - Function to apply an ordering other than specified by quality
        Returns:
        List the values in quality order with the q param and OWS stripped
      • getQualityCSV

        default java.util.List<java.lang.String> getQualityCSV​(java.lang.String name)
        Get multiple field values of the same name, split and sorted as a QuotedQualityCSV
        Parameters:
        name - the case-insensitive field name
        Returns:
        List the values in quality order with the q param and OWS stripped
      • getValues

        default java.util.Enumeration<java.lang.String> getValues​(java.lang.String name)
        Get multi headers
        Parameters:
        name - the case-insensitive field name
        Returns:
        Enumeration of the values
      • getValuesList

        default java.util.List<java.lang.String> getValuesList​(HttpHeader header)
        Get multiple field values of the same name
        Parameters:
        header - the header
        Returns:
        List the values
      • getValuesList

        default java.util.List<java.lang.String> getValuesList​(java.lang.String name)
        Get multiple header of the same name
        Parameters:
        name - the case-insensitive field name
        Returns:
        List the header values
      • isEqualTo

        default boolean isEqualTo​(HttpFields that)
      • size

        int size()
      • stream

        java.util.stream.Stream<HttpField> stream()