B
- The message bodypublic class HttpMessageWrapper<B> extends java.lang.Object implements HttpMessage<B>
HttpMessage
.Constructor and Description |
---|
HttpMessageWrapper(HttpMessage<B> delegate) |
Modifier and Type | Method and Description |
---|---|
MutableConvertibleValues<java.lang.Object> |
getAttributes()
A
MutableConvertibleValues of the attributes for this HTTP message. |
java.util.Optional<B> |
getBody() |
<T> java.util.Optional<T> |
getBody(Argument<T> type)
Return the body as the given type.
|
<T> java.util.Optional<T> |
getBody(java.lang.Class<T> type)
Return the body as the given type.
|
HttpMessage<B> |
getDelegate() |
HttpHeaders |
getHeaders() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCharacterEncoding, getContentLength, getContentType, getLocale, setAttribute
removeAttribute
getAttribute, getAttribute
public HttpMessageWrapper(HttpMessage<B> delegate)
delegate
- The Http messagepublic HttpMessage<B> getDelegate()
public HttpHeaders getHeaders()
getHeaders
in interface HttpMessage<B>
HttpHeaders
objectpublic MutableConvertibleValues<java.lang.Object> getAttributes()
HttpMessage
A 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 AttributeHolder
getAttributes
in interface MutableAttributeHolder
getAttributes
in interface HttpMessage<B>
public java.util.Optional<B> getBody()
getBody
in interface HttpMessage<B>
public <T> java.util.Optional<T> getBody(java.lang.Class<T> type)
HttpMessage
getBody
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 <T> java.util.Optional<T> getBody(Argument<T> type)
HttpMessage
getBody
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 type