Class Headers

    • Method Detail

      • of

        public static Headers of​(Header... headers)
        Creates a headers element.
        Parameters:
        headers - The headers.
        Returns:
        The header.
      • of

        public static Headers of​(Collection<Header> headers)
        Creates a headers element.
        Parameters:
        headers - The headers.
        Returns:
        The header.
      • of

        public static Headers of​(Map<String,​String> headers)
        Creates a headers element from a map.
        Parameters:
        headers - The headers.
        Returns:
        The header.
      • findValue

        public final String findValue​(String name)
        Tries to find a value among the headers associated with header name.
        Parameters:
        name - The name of the header.
        Returns:
        The found value or null if none could be found.
      • getHeaders

        public final List<Header> getHeaders()
        Gets the headers.
        Returns:
        The headers.
      • withHeader

        public final Headers withHeader​(String name,
                                        String value)
        Creates a new headers extension with an additional header. If the header already exists (by their name), it is replaced; otherwise it's added.
        Parameters:
        name - The header name.
        value - The header value.
        Returns:
        The headers.
      • withHeader

        public final Headers withHeader​(Header header)
        Creates a new headers extension with an additional header. If the header already exists (by their name), it is replaced; otherwise it's added.
        Parameters:
        header - The header.
        Returns:
        The headers.
      • withoutHeader

        public final Headers withoutHeader​(String name)
        Removes a header from this collection.
        Parameters:
        name - The header name.
        Returns:
        The headers.