HttpResponse.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private Locale | |
| private final ReasonPhraseCatalog | |
| private String | |
| private static final long | |
| private ProtocolVersion |
| Access | Constructor and Description |
|---|---|
| public | BasicHttpResponse(final int
the status code code, final ReasonPhraseCatalog the reason phrase catalog, or
catalog, final Locale null to disable automatic
reason phrase lookupthe locale for looking up reason phrases, or
locale)null for the system localeCreates a new response. |
| public | BasicHttpResponse(final int
the status code of the response code, final String the reason phrase to the status code, or reasonPhrase)nullCreates a new response. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addHeader(final String
the name of the header. name, final Object the value of the header, taken as the value's value)Object#toString().Implements org. |
| public int | getCode()
Implements org. |
| public Locale | getLocale()
Implements org. |
| protected String | Returns: the reason phrase, ornull if there is nonethe status code for which to look up the reason code)Looks up a reason phrase. |
| public String | getReasonPhrase()
Implements org. |
| public ProtocolVersion | getVersion()
Implements org. null when not available.
|
| public void | setCode(final int
the HTTP status code. code)Implements org. |
| public void | setHeader(final String
the name of the header. name, final Object the value of the header, taken as the value's value)Object#toString().Implements org. |
| public void | setLocale(final Locale
the new locale locale)Implements org. |
| public void | setReasonPhrase(final String
the new reason phrase as a single-line string, or
reason)null to unset the reason phraseImplements org. |
| public void | setVersion(final ProtocolVersion version)
Implements org. |
| public String | toString()
Overrides org. |
| code | back to summary |
|---|---|
| private int code | |
| locale | back to summary |
|---|---|
| private Locale locale | |
| reasonCatalog | back to summary |
|---|---|
| private final ReasonPhraseCatalog reasonCatalog | |
| reasonPhrase | back to summary |
|---|---|
| private String reasonPhrase | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. | |
| version | back to summary |
|---|---|
| private ProtocolVersion version | |
| BasicHttpResponse | back to summary |
|---|---|
| public BasicHttpResponse(final int code, final ReasonPhraseCatalog catalog, final Locale locale) Creates a new response.
| |
| BasicHttpResponse | back to summary |
|---|---|
| public BasicHttpResponse(final int code, final String reasonPhrase) Creates a new response.
| |
| BasicHttpResponse | back to summary |
|---|---|
| public BasicHttpResponse(final int code) Creates a new response.
| |
| addHeader | back to summary |
|---|---|
| public void addHeader(final String name, final Object value) Implements org. Doc from org. Adds a header to this message. The header will be appended to the end of the list.
| |
| getCode | back to summary |
|---|---|
| public int getCode() Implements org. Doc from org. Obtains the code of this response message.
| |
| getLocale | back to summary |
|---|---|
| public Locale getLocale() Implements org. Doc from org. Obtains the locale of this response.
The locale is used to determine the reason phrase
for the | |
| getReason | back to summary |
|---|---|
| protected String getReason(final int code) Looks up a reason phrase. This method evaluates the currently set catalog and locale. It also handles a missing catalog.
| |
| getReasonPhrase | back to summary |
|---|---|
| public String getReasonPhrase() Implements org. Doc from org. Obtains the reason phrase of this response if available. | |
| getVersion | back to summary |
|---|---|
| public ProtocolVersion getVersion() Implements org. Doc from org. Returns protocol version or For incoming messages it represents protocol version this message was transmitted with. For outgoing messages it represents a hint what protocol version should be used to transmit the message.
| |
| setCode | back to summary |
|---|---|
| public void setCode(final int code) Implements org. Doc from org. Updates status code of this response message.
| |
| setHeader | back to summary |
|---|---|
| public void setHeader(final String name, final Object value) Implements org. Doc from org. Overwrites the first header with the same name. The new header will be appended to the end of the list, if no header with the given name can be found.
| |
| setLocale | back to summary |
|---|---|
| public void setLocale(final Locale locale) Implements org. Doc from org. Changes the locale of this response. | |
| setReasonPhrase | back to summary |
|---|---|
| public void setReasonPhrase(final String reason) Implements org. Doc from org. Updates the status line of this response with a new reason phrase. | |
| setVersion | back to summary |
|---|---|
| public void setVersion(final ProtocolVersion version) Implements org. Doc from org. Sets protocol version. For incoming messages it represents protocol version this message was transmitted with. For outgoing messages it represents a hint what protocol version should be used to transmit the message.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object. | |