Class MessageImpl<T extends MessageImpl<T>>

  • Type Parameters:
    T - The sub-type of this message.
    All Implemented Interfaces:
    Closeable, AutoCloseable, Message<T>
    Direct Known Subclasses:
    Request, Response

    public abstract class MessageImpl<T extends MessageImpl<T>>
    extends Object
    implements Message<T>
    Abstract message base class.
    • Method Detail

      • close

        public void close()
        Description copied from interface: Message
        Closes all resources associated with the entity. Any open streams will be closed, and the underlying content reset back to a zero length.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface Message<T extends MessageImpl<T>>
        See Also:
        Entity.close()
      • addHeaders

        public T addHeaders​(Header... headers)
        Description copied from interface: Message
        Add one or more headers to the message.
        Specified by:
        addHeaders in interface Message<T extends MessageImpl<T>>
        Parameters:
        headers - The headers.
        Returns:
        This message.
      • putHeaders

        public T putHeaders​(Header... headers)
        Description copied from interface: Message
        Put one or more headers to the message. This will overwrite any existing header values for the names of the headers provided.
        Specified by:
        putHeaders in interface Message<T extends MessageImpl<T>>
        Parameters:
        headers - The headers.
        Returns:
        This message.
      • getVersion

        public final String getVersion()
        Description copied from interface: Message
        Returns the protocol version. Default: HTTP/1.1.
        Specified by:
        getVersion in interface Message<T extends MessageImpl<T>>
        Returns:
        The protocol version.