Interface HttpFields<B extends HttpFields<B>>

    • Method Detail

      • getFirst

        default String getFirst​(String aField)
        Returns the first Header-Field value in the list of values associated with the given Header-Field.
        Parameters:
        aField - The Header-Field (key) of which's values the first value is to be retrieved.
        Returns:
        The first value in the list of values associated to the given Header-Field (key).
      • put

        default List<String> put​(String aField,
                                 String aValue)
        Sets a single value for the Header-Field (key). Any values previously associated to the given Header-Field (key) are lost.
        Parameters:
        aField - The Header-Field for which to set a single value.
        aValue - The single value to be set for the Header-Field (key).
        Returns:
        the list
      • put

        default List<String> put​(String aField,
                                 String... aValues)
        Performs a #set(String, String) on multiple values.
        Parameters:
        aField - The Header-Field for which to set the values.
        aValues - The values to be set for the Header-Field (key).
        Returns:
        the list
      • withPut

        default B withPut​(String aField,
                          String aValue)
        Builder method for the put(String, String) method.
        Parameters:
        aField - The Header-Field for which to set a single value.
        aValue - The single value to be set for the Header-Field (key).
        Returns:
        This HttpFields instance to continue building up the Header-Fields.
      • withPut

        default B withPut​(String aField,
                          List<String> aValues)
        Builder method for the Map.put(Object, Object) method.
        Parameters:
        aField - The Header-Field for which to set the values.
        aValues - The values to be set for the Header-Field (key).
        Returns:
        This HttpFields instance to continue building up the Header-Fields.
      • withPut

        default B withPut​(String aField,
                          String... aValues)
        Builder method for the put(String, String...) method.
        Parameters:
        aField - The Header-Field for which to set the values.
        aValues - The values to be set for the Header-Field (key).
        Returns:
        This HttpFields instance to continue building up the Header-Fields.
      • addTo

        default void addTo​(String aField,
                           String aValue)
        Adds a value to the list of values associated with the given Header-Field (key).
        Parameters:
        aField - The Header-Field (key) of which's list of values a value is to be added.
        aValue - The value to be added to the list of values associated to the given Header-Field (key).
      • addTo

        default void addTo​(String aField,
                           String... aValues)
        Adds values to the list of values associated with the given Header-Field (key).
        Parameters:
        aField - The Header-Field (key) of which's list of values the values are to be added.
        aValues - The values to be added to the list of values associated to the given Header-Field (key).
      • addTo

        default void addTo​(String aField,
                           List<String> aValues)
        Adds values to the list of values associated with the given Header-Field (key),.
        Parameters:
        aField - The Header-Field (key) of which's list of values the values are to be added.
        aValues - The values to be added to the list of values associated to the given Header-Field (key).
      • withAddTo

        default B withAddTo​(String aField,
                            String aValue)
        Builder method for the addTo(String, String) method.
        Parameters:
        aField - The Header-Field (key) of which's list of values a value is to be added.
        aValue - The value to be added to the list of values associated to the given Header-Field (key).
        Returns:
        This HttpFields instance to continue building up the Header-Fields.
      • withAddTo

        default B withAddTo​(String aField,
                            String... aValues)
        Builder method for the addTo(String, String...) method.
        Parameters:
        aField - The Header-Field (key) of which's list of values the values are to be added.
        aValues - The values to be added to the list of values associated to the given Header-Field (key).
        Returns:
        This HttpFields instance to continue building up the Header-Fields.
      • withAddTo

        default B withAddTo​(String aField,
                            List<String> aValues)
        Builder method for the addTo(String, List) method.
        Parameters:
        aField - The Header-Field (key) of which's list of values the values are to be added.
        aValues - The values to be added to the list of values associated to the given Header-Field (key).
        Returns:
        This HttpFields instance to continue building up the Header-Fields.
      • toField

        default String toField​(String aKey)
        This method returns a single String (instead of returning a List of String instances when calling Map.get(Object)) where the elements of the filed are separated by the Delimiter.HTTP_HEADER_ELEMENTS and concatenated as a single String.
        Parameters:
        aKey - The field's key for which's elements to retrieve a comma separated String
        Returns:
        The comma separated String of the according elements or null if none such field was found.