AbstractResponseAdapterpublic abstract class AbstractResponse
extends java.lang.Object
This class is generally not thread-safe. It is primarily designed for use in a single thread only.
| Constructor | Description |
|---|---|
AbstractResponse() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addHeader(java.lang.String name,
java.lang.String value) |
Add the given single header value to the current list of values
for the given header.
|
boolean |
containsHeader(java.lang.String name) |
Returns a boolean indicating whether the named response header
has already been set.
|
java.lang.String |
getHeader(java.lang.String name) |
Returns the value of the response header with the given name.
|
java.util.Collection<java.lang.String> |
getHeaderNames() |
Returns the names of the headers of this response.
|
MultiValueMap<java.lang.String,java.lang.String> |
getHeaders() |
Returns a map of the request headers that can be modified.
|
java.util.Collection<java.lang.String> |
getHeaders(java.lang.String name) |
Returns the values of the response header with the given name.
|
int |
getStatus() |
Returns the status code.
|
void |
setHeader(java.lang.String name,
java.lang.String value) |
Set the given single header value under the given header name.
|
void |
setStatus(int status) |
Sets the status code.
|
MultiValueMap<java.lang.String,java.lang.String> |
touchHeaders() |
Returns a map of the request headers that can be modified.
|
public MultiValueMap<java.lang.String,java.lang.String> touchHeaders()
MultiValueMap object, may not be nullpublic MultiValueMap<java.lang.String,java.lang.String> getHeaders()
MultiValueMap object, may be nullpublic java.lang.String getHeader(java.lang.String name)
If a response header with the given name exists and contains multiple values, the value that was added first will be returned.
name - the name of the response header whose value to returnnull if no header with the given name has been set
on this responsepublic java.util.Collection<java.lang.String> getHeaders(java.lang.String name)
name - the name of the response header whose values to returnCollection of the values
of the response header with the given namepublic java.util.Collection<java.lang.String> getHeaderNames()
Collection of the names
of the headers of this responsepublic boolean containsHeader(java.lang.String name)
name - the header nametrue if the named response header
has already been set; false otherwisepublic void setHeader(java.lang.String name,
java.lang.String value)
name - the header namevalue - the header value to setpublic void addHeader(java.lang.String name,
java.lang.String value)
name - the header namevalue - the header value to be addedpublic int getStatus()
public void setStatus(int status)
status - the status codeCopyright © 2008–2018 The Aspectran Project. All rights reserved.