B - The response body@Internal public class NettyMutableHttpResponse<B> extends Object implements MutableHttpResponse<B>
FullHttpResponse.| Modifier and Type | Field and Description |
|---|---|
protected io.netty.handler.codec.http.FullHttpResponse |
nettyResponse |
| Constructor and Description |
|---|
NettyMutableHttpResponse(ConversionService conversionService) |
NettyMutableHttpResponse(io.netty.handler.codec.http.FullHttpResponse nettyResponse,
ConversionService conversionService) |
| Modifier and Type | Method and Description |
|---|---|
NettyMutableHttpResponse<B> |
body(B body)
Sets the body.
|
MutableHttpResponse<B> |
cookie(Cookie cookie)
Adds the specified cookie to the response.
|
MutableConvertibleValues<Object> |
getAttributes()
A
MutableConvertibleValues of the attributes for this HTTP message. |
Optional<B> |
getBody() |
<T> Optional<T> |
getBody(Argument<T> type)
Return the body as the given type.
|
<T1> Optional<T1> |
getBody(Class<T1> type)
Return the body as the given type.
|
Optional<MediaType> |
getContentType()
The request or response content type.
|
MutableHttpHeaders |
getHeaders() |
io.netty.handler.codec.http.FullHttpResponse |
getNativeResponse() |
HttpStatus |
getStatus() |
NettyMutableHttpResponse |
replace(io.netty.buffer.ByteBuf body) |
MutableHttpResponse<B> |
status(HttpStatus status,
CharSequence message)
Sets the response status.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcharacterEncoding, characterEncoding, contentEncoding, contentLength, contentType, contentType, header, headers, headers, locale, status, status, statusaccepted, accepted, badRequest, badRequest, body, code, created, created, created, header, noContent, notAllowed, notAllowed, notFound, notFound, notModified, ok, ok, permanentRedirect, reason, redirect, seeOther, serverError, serverError, setAttribute, status, status, status, temporaryRedirect, unauthorized, unprocessableEntity, uribasicAuth, bearerAuthgetCharacterEncoding, getContentLength, getLocaleremoveAttributegetAttribute, getAttributepublic NettyMutableHttpResponse(io.netty.handler.codec.http.FullHttpResponse nettyResponse,
ConversionService conversionService)
nettyResponse - The FullHttpResponseconversionService - The conversion servicepublic NettyMutableHttpResponse(ConversionService conversionService)
conversionService - The conversion servicepublic Optional<MediaType> getContentType()
HttpMessagegetContentType in interface HttpMessage<B>public MutableHttpHeaders getHeaders()
getHeaders in interface HttpMessage<B>getHeaders in interface MutableHttpMessage<B>HttpHeaders objectpublic MutableConvertibleValues<Object> getAttributes()
HttpMessageA MutableConvertibleValues of the attributes for this HTTP message.
Attributes are designed for internal data sharing and hence are isolated from headers and parameters which are client supplied
getAttributes in interface AttributeHoldergetAttributes in interface MutableAttributeHoldergetAttributes in interface HttpMessage<B>public HttpStatus getStatus()
getStatus in interface HttpResponse<B>public MutableHttpResponse<B> cookie(Cookie cookie)
MutableHttpResponsecookie in interface MutableHttpResponse<B>cookie - the Cookie to return to the clientpublic Optional<B> getBody()
getBody in interface HttpMessage<B>public <T1> Optional<T1> getBody(Class<T1> type)
HttpMessagegetBody in interface HttpMessage<B>T1 - The generic typetype - The type of the bodyOptional of the type or Optional.empty() if the body cannot be returned as the given typepublic <T> Optional<T> getBody(Argument<T> type)
HttpMessagegetBody in interface HttpMessage<B>T - The generic typetype - The type of the bodyOptional of the type or Optional.empty() if the body cannot be returned as the given typepublic MutableHttpResponse<B> status(HttpStatus status, CharSequence message)
MutableHttpResponsestatus in interface MutableHttpResponse<B>status - The statusmessage - The messagepublic io.netty.handler.codec.http.FullHttpResponse getNativeResponse()
FullHttpResponsepublic NettyMutableHttpResponse<B> body(B body)
MutableHttpResponsebody in interface MutableHttpMessage<B>body in interface MutableHttpResponse<B>body - The bodypublic NettyMutableHttpResponse replace(io.netty.buffer.ByteBuf body)
body - The body to replace