Class Response

  • All Implemented Interfaces:
    Recyclable

    public class Response
    extends java.lang.Object
    implements Recyclable
    • Constructor Detail

      • Response

        public Response()
    • Method Detail

      • isFinished

        public boolean isFinished()
        A boolean indicating whether the response was finished or not
      • withFinished

        public Response withFinished​(boolean finished)
        A boolean indicating whether the response was finished or not
      • addHeader

        public Response addHeader​(java.lang.String headerName,
                                  java.lang.String headerValue)
        Adds a response header.
        Parameters:
        headerName - The name of the header.
        headerValue - The value of the header.
        Returns:
        this, for fluent method chaining
      • addHeader

        public Response addHeader​(java.lang.String headerName,
                                  @Nullable
                                  java.util.Collection<java.lang.String> headerValues)
      • isHeadersSent

        public boolean isHeadersSent()
      • withHeadersSent

        public Response withHeadersSent​(boolean headersSent)
      • getStatusCode

        public int getStatusCode()
        The HTTP status code of the response.
      • withStatusCode

        public Response withStatusCode​(int statusCode)
        The HTTP status code of the response.
      • resetState

        public void resetState()
        Description copied from interface: Recyclable
        resets pooled object state so it can be reused
        Specified by:
        resetState in interface Recyclable
      • copyFrom

        public void copyFrom​(Response other)
      • hasContent

        public boolean hasContent()