Class HttpHeadersBuilder

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      HttpRequestHeaders add​(java.lang.String headerName, java.lang.String headerValue)
      Adds the given name value pair to the set of headers for this request.
      void forEach​(java.util.function.BiConsumer<java.lang.String,​java.util.List<java.lang.String>> callback)
      Performs the provided callback for each header.
      java.util.List<java.lang.String> get​(java.lang.String headerName)
      Get an immutable list of header values for the given header name, possibly empty.
      HttpRequestHeaders remove​(java.lang.String headerName)
      Removes the header with the specified name, if present.
      HttpRequestHeaders set​(java.lang.String headerName, java.lang.String... headerValues)
      Sets the given name value pair to the set of headers for this request.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HttpHeadersBuilder

        public HttpHeadersBuilder()
    • Method Detail

      • add

        public HttpRequestHeaders add​(java.lang.String headerName,
                                      java.lang.String headerValue)
        Description copied from interface: HttpRequestHeaders
        Adds the given name value pair to the set of headers for this request. The given value is added to the list of values for that name.
        Specified by:
        add in interface HttpRequestHeaders
        Parameters:
        headerName - the header name
        headerValue - the header value
        Returns:
        this instance
      • set

        public HttpRequestHeaders set​(java.lang.String headerName,
                                      java.lang.String... headerValues)
        Description copied from interface: HttpRequestHeaders
        Sets the given name value pair to the set of headers for this request.
        Specified by:
        set in interface HttpRequestHeaders
        Parameters:
        headerName - the header name
        headerValues - the header values
        Returns:
        this instance
      • remove

        public HttpRequestHeaders remove​(java.lang.String headerName)
        Description copied from interface: HttpRequestHeaders
        Removes the header with the specified name, if present.
        Specified by:
        remove in interface HttpRequestHeaders
        Parameters:
        headerName - the header name
        Returns:
        this instance
      • get

        public java.util.List<java.lang.String> get​(java.lang.String headerName)
        Description copied from interface: HttpRequestHeaders
        Get an immutable list of header values for the given header name, possibly empty.
        Specified by:
        get in interface HttpRequestHeaders
        Parameters:
        headerName - the header name
        Returns:
        the list of header values, or an empty list
      • forEach

        public void forEach​(java.util.function.BiConsumer<java.lang.String,​java.util.List<java.lang.String>> callback)
        Description copied from interface: HttpRequestHeaders
        Performs the provided callback for each header.
        Specified by:
        forEach in interface HttpRequestHeaders