Interface HttpBaseResponse

All Superinterfaces:
BaseResponse
All Known Subinterfaces:
GenericResponse, HttpMessageResponse, HttpPlainResponse, HttpResponse, HttpResponse, MessageResponse, Response, TcpResponse

public interface HttpBaseResponse extends BaseResponse
Base interface for all http-based responses. Defines the common information that can be accessed for any http-based responses.
Author:
Jeoffrey HAEYAERT (jeoffrey.haeyaert at graviteesource.com), GraviteeSource Team
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates if the response is ended or not.
     
    default boolean
    Indicates if response has status in 100-199 range.
    default boolean
    Indicates if response has status in 200-299 range.
    default boolean
    Indicates if response has status in 300-399 range.
    default boolean
    Indicates if response has status in 400-499 range.
    default boolean
    Indicates if response has status in 500-599 range.
     
    reason(String message)
    Set the reason message.
    int
    Return the current http status.
    status(int statusCode)
    Set the status code of the http response.
     
  • Method Details

    • status

      HttpBaseResponse status(int statusCode)
      Set the status code of the http response.
      Parameters:
      statusCode - the status code to set.
      Returns:
      a self-reference.
    • status

      int status()
      Return the current http status.
      Returns:
      the current status code.
    • reason

      String reason()
      Returns:
      Reason-Phrase is intended to give a short textual description of the Status-Code.
    • reason

      HttpBaseResponse reason(String message)
      Set the reason message.
      Parameters:
      message - the message to set as a reason.
      Returns:
      a self-reference.
    • headers

      HttpHeaders headers()
      Returns:
      the headers in the response.
    • trailers

      HttpHeaders trailers()
      Returns:
      the trailers in the response (http/2).
    • ended

      boolean ended()
      Indicates if the response is ended or not. Ended response means the response has been fully push to the client, including response body.
      Returns:
      true if the response has been fully pushed to the client, false else.
    • isStatus1xx

      default boolean isStatus1xx()
      Indicates if response has status in 100-199 range.
      Returns:
      true if status is 1xx
    • isStatus2xx

      default boolean isStatus2xx()
      Indicates if response has status in 200-299 range.
      Returns:
      true if status is 2xx
    • isStatus3xx

      default boolean isStatus3xx()
      Indicates if response has status in 300-399 range.
      Returns:
      true if status is 3xx
    • isStatus4xx

      default boolean isStatus4xx()
      Indicates if response has status in 400-499 range.
      Returns:
      true if status is 4xx
    • isStatus5xx

      default boolean isStatus5xx()
      Indicates if response has status in 500-599 range.
      Returns:
      true if status is 5xx