Class ServletResponseFactory

java.lang.Object
io.micronaut.servlet.http.ServletResponseFactory
All Implemented Interfaces:
io.micronaut.http.HttpResponseFactory

public class ServletResponseFactory extends Object implements io.micronaut.http.HttpResponseFactory
An implementation of the HttpResponseFactory case that retrieves the response object from the current request bound to the current thread.
Since:
2.0.0
Author:
graemerocher
  • Field Summary

    Fields inherited from interface io.micronaut.http.HttpResponseFactory

    INSTANCE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> io.micronaut.http.MutableHttpResponse<T>
    ok(T body)
     
    <T> io.micronaut.http.MutableHttpResponse<T>
    status(int status, String reason)
     
    <T> io.micronaut.http.MutableHttpResponse<T>
    status(io.micronaut.http.HttpStatus status, String reason)
     
    <T> io.micronaut.http.MutableHttpResponse<T>
    status(io.micronaut.http.HttpStatus status, T body)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.micronaut.http.HttpResponseFactory

    ok, status
  • Constructor Details

    • ServletResponseFactory

      public ServletResponseFactory()
  • Method Details

    • ok

      public <T> io.micronaut.http.MutableHttpResponse<T> ok(T body)
      Specified by:
      ok in interface io.micronaut.http.HttpResponseFactory
    • status

      public <T> io.micronaut.http.MutableHttpResponse<T> status(io.micronaut.http.HttpStatus status, String reason)
      Specified by:
      status in interface io.micronaut.http.HttpResponseFactory
    • status

      public <T> io.micronaut.http.MutableHttpResponse<T> status(int status, String reason)
      Specified by:
      status in interface io.micronaut.http.HttpResponseFactory
    • status

      public <T> io.micronaut.http.MutableHttpResponse<T> status(io.micronaut.http.HttpStatus status, T body)
      Specified by:
      status in interface io.micronaut.http.HttpResponseFactory