public final class ResponseHeader extends MessageHeader
The headers are however still provided, in case information needs to be extracted out of non standard headers.
Modifier and Type | Field and Description |
---|---|
static ResponseHeader |
NO_CONTENT |
static ResponseHeader |
OK |
Constructor and Description |
---|
ResponseHeader(int status,
MessageProtocol protocol,
org.pcollections.PMap<String,org.pcollections.PSequence<String>> headers) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
hashCode() |
ResponseHeader |
replaceAllHeaders(org.pcollections.PMap<String,org.pcollections.PSequence<String>> headers)
Return a copy of this message header with the headers replaced by the given map of headers.
|
int |
status()
Get the status of this response.
|
String |
toString() |
ResponseHeader |
withHeader(String name,
String value)
Return a copy of this message header with the given header added to the map of headers.
|
ResponseHeader |
withProtocol(MessageProtocol protocol)
Return a copy of this message header with the given protocol.
|
ResponseHeader |
withStatus(int status)
Return a copy of this response header with the status set.
|
getHeader, headers, protocol
public static final ResponseHeader OK
public static final ResponseHeader NO_CONTENT
public ResponseHeader(int status, MessageProtocol protocol, org.pcollections.PMap<String,org.pcollections.PSequence<String>> headers)
public int status()
public ResponseHeader withStatus(int status)
status
- The status to set.public ResponseHeader withProtocol(MessageProtocol protocol)
MessageHeader
withProtocol
in class MessageHeader
protocol
- The protocol to set.public ResponseHeader replaceAllHeaders(org.pcollections.PMap<String,org.pcollections.PSequence<String>> headers)
MessageHeader
replaceAllHeaders
in class MessageHeader
headers
- The map of headers.public ResponseHeader withHeader(String name, String value)
MessageHeader
If the header already has a value, this value will replace it.
withHeader
in class MessageHeader
name
- The name of the header to add.value
- The value of the header to add.