Class AbstractServletHttpResponse<R,B>

java.lang.Object
io.micronaut.function.aws.proxy.AbstractServletHttpResponse<R,B>
Type Parameters:
R - Response Type
B - Body Type
All Implemented Interfaces:
io.micronaut.core.attr.AttributeHolder, io.micronaut.core.attr.MutableAttributeHolder, io.micronaut.http.HttpMessage<B>, io.micronaut.http.HttpResponse<B>, io.micronaut.http.MutableHttpMessage<B>, io.micronaut.http.MutableHttpResponse<B>, io.micronaut.servlet.http.ServletHttpResponse<R,B>
Direct Known Subclasses:
ApiGatewayProxyServletResponse, APIGatewayV2HTTPResponseServletResponse, ApplicationLoadBalancerServletResponse

@Internal public abstract class AbstractServletHttpResponse<R,B> extends Object implements io.micronaut.servlet.http.ServletHttpResponse<R,B>
Abstract class for implementations of ServletHttpResponse.
Since:
4.0.0
Author:
Sergio del Amo
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final io.micronaut.function.BinaryTypeConfiguration
     
    protected final ByteArrayOutputStream
     
    protected final io.micronaut.http.MutableHttpHeaders
     
    protected int
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractServletHttpResponse(io.micronaut.core.convert.ConversionService conversionService, io.micronaut.function.BinaryTypeConfiguration binaryTypeConfiguration)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> io.micronaut.http.MutableHttpResponse<T>
    body(T body)
     
    int
     
    io.micronaut.http.MutableHttpResponse<B>
    cookie(io.micronaut.http.cookie.Cookie cookie)
     
    io.micronaut.core.convert.value.MutableConvertibleValues<Object>
     
     
    io.micronaut.http.MutableHttpHeaders
     
     
     
     
    io.micronaut.http.MutableHttpResponse<B>
    status(int status, CharSequence message)
     

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface io.micronaut.core.attr.AttributeHolder

    getAttribute, getAttribute

    Methods inherited from interface io.micronaut.http.HttpMessage

    getBody, getBody, getBody, getBodyWriter, getCharacterEncoding, getContentLength, getContentType, getLocale

    Methods inherited from interface io.micronaut.http.HttpResponse

    body, getCookie, getCookies, getStatus, header, setAttribute, status

    Methods inherited from interface io.micronaut.core.attr.MutableAttributeHolder

    removeAttribute

    Methods inherited from interface io.micronaut.http.MutableHttpMessage

    basicAuth, bearerAuth, bodyWriter

    Methods inherited from interface io.micronaut.http.MutableHttpResponse

    attribute, characterEncoding, characterEncoding, contentEncoding, contentLength, contentType, contentType, cookies, header, headers, headers, locale, status, status, status, toMutableResponse

    Methods inherited from interface io.micronaut.servlet.http.ServletHttpResponse

    getNativeResponse, stream
  • Field Details

    • body

      protected final ByteArrayOutputStream body
    • status

      protected int status
    • headers

      protected final io.micronaut.http.MutableHttpHeaders headers
    • binaryTypeConfiguration

      protected final io.micronaut.function.BinaryTypeConfiguration binaryTypeConfiguration
  • Constructor Details

    • AbstractServletHttpResponse

      protected AbstractServletHttpResponse(io.micronaut.core.convert.ConversionService conversionService, io.micronaut.function.BinaryTypeConfiguration binaryTypeConfiguration)
  • Method Details

    • getOutputStream

      public OutputStream getOutputStream()
      Specified by:
      getOutputStream in interface io.micronaut.servlet.http.ServletHttpResponse<R,B>
    • getWriter

      public BufferedWriter getWriter()
      Specified by:
      getWriter in interface io.micronaut.servlet.http.ServletHttpResponse<R,B>
    • cookie

      public io.micronaut.http.MutableHttpResponse<B> cookie(io.micronaut.http.cookie.Cookie cookie)
      Specified by:
      cookie in interface io.micronaut.http.MutableHttpResponse<R>
    • getHeaders

      public io.micronaut.http.MutableHttpHeaders getHeaders()
      Specified by:
      getHeaders in interface io.micronaut.http.HttpMessage<R>
      Specified by:
      getHeaders in interface io.micronaut.http.MutableHttpMessage<R>
    • getAttributes

      public io.micronaut.core.convert.value.MutableConvertibleValues<Object> getAttributes()
      Specified by:
      getAttributes in interface io.micronaut.core.attr.AttributeHolder
      Specified by:
      getAttributes in interface io.micronaut.http.HttpMessage<R>
      Specified by:
      getAttributes in interface io.micronaut.core.attr.MutableAttributeHolder
    • getBody

      public Optional<B> getBody()
      Specified by:
      getBody in interface io.micronaut.http.HttpMessage<R>
    • body

      public <T> io.micronaut.http.MutableHttpResponse<T> body(@Nullable T body)
      Specified by:
      body in interface io.micronaut.http.MutableHttpMessage<R>
      Specified by:
      body in interface io.micronaut.http.MutableHttpResponse<R>
    • status

      public io.micronaut.http.MutableHttpResponse<B> status(int status, CharSequence message)
      Specified by:
      status in interface io.micronaut.http.MutableHttpResponse<R>
    • code

      public int code()
      Specified by:
      code in interface io.micronaut.http.HttpResponse<R>
    • reason

      public String reason()
      Specified by:
      reason in interface io.micronaut.http.HttpResponse<R>