public final class RsWithType extends RsWrap
The class is immutable and thread-safe.
Modifier and Type | Class and Description |
---|---|
static class |
RsWithType.Html
Response decorator, with content type text/html.
|
static class |
RsWithType.Json
Response decorator, with content type application/json.
|
static class |
RsWithType.Text
Response decorator, with content type text/plain.
|
static class |
RsWithType.Xml
Response decorator, with content type text/xml.
|
Constructor and Description |
---|
RsWithType(Response res,
CharSequence type)
Constructs a
RsWithType that will add the content type header to
the response using the specified type as media type. |
RsWithType(Response res,
CharSequence type,
Charset charset)
Constructs a
RsWithType that will add the content type header to
the response using the specified type as media type and the specified
charset as charset parameter value. |
public RsWithType(Response res, CharSequence type)
RsWithType
that will add the content type header to
the response using the specified type as media type.
The resulting header is of type Content-Type: media-type
.
res
- Original responsetype
- Content typepublic RsWithType(Response res, CharSequence type, Charset charset)
RsWithType
that will add the content type header to
the response using the specified type as media type and the specified
charset as charset parameter value.
The resulting header
is of type Content-Type: media-type; charset=charset-value
.
res
- Original responsetype
- Content typecharset
- The character set to add in the content type headerCopyright © 2015–2018 Take. All rights reserved.