Interface HttpResponseFactory

All Known Implementing Classes:
NettyHttpResponseFactory, SimpleHttpResponseFactory

public interface HttpResponseFactory
A factory interface for creating MutableHttpResponse instances.
Since:
1.0
Author:
Graeme Rocher
  • Field Details

  • Method Details

    • ok

      <T> MutableHttpResponse<T> ok(T body)
      Creates an HttpStatus.OK response with a body.
      Type Parameters:
      T - The body type
      Parameters:
      body - The body
      Returns:
      The ok response with the given body
    • status

      <T> MutableHttpResponse<T> status(HttpStatus status, String reason)
      Return a response for the given status.
      Type Parameters:
      T - The response type
      Parameters:
      status - The status
      reason - An alternative reason message
      Returns:
      The response
    • status

      <T> MutableHttpResponse<T> status(int status, String reason)
      Return a response for the given status.
      Type Parameters:
      T - The response type
      Parameters:
      status - The status
      reason - An alternative reason message
      Returns:
      The response
    • status

      <T> MutableHttpResponse<T> status(HttpStatus status, T body)
      Return a response for the given status.
      Type Parameters:
      T - The body type
      Parameters:
      status - The status
      body - The body
      Returns:
      The response
    • ok

      default <T> MutableHttpResponse<T> ok()
      Type Parameters:
      T - The response type
      Returns:
      The ok response
    • status

      default <T> MutableHttpResponse<T> status(HttpStatus status)
      Type Parameters:
      T - The response type
      Parameters:
      status - The status
      Returns:
      The restus response