Package org.apache.hc.core5.http.message
Class HttpResponseWrapper
java.lang.Object
org.apache.hc.core5.http.message.AbstractMessageWrapper<HttpResponse>
org.apache.hc.core5.http.message.HttpResponseWrapper
- All Implemented Interfaces:
HttpMessage,HttpResponse,MessageHeaders
public class HttpResponseWrapper
extends AbstractMessageWrapper<HttpResponse>
implements HttpResponse
Wraps an
HttpResponse.
HttpResponse wrapper.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetCode()Obtains the code of this response message.Obtains the locale of this response.Obtains the reason phrase of this response if available.voidsetCode(int code) Updates status code of this response message.voidChanges the locale of this response.voidsetReasonPhrase(String reason) Updates the status line of this response with a new reason phrase.Methods inherited from class org.apache.hc.core5.http.message.AbstractMessageWrapper
addHeader, addHeader, containsHeader, countHeaders, getFirstHeader, getHeader, getHeaders, getHeaders, getLastHeader, getMessage, getVersion, headerIterator, headerIterator, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setVersion, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hc.core5.http.HttpMessage
addHeader, addHeader, getVersion, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setVersionMethods inherited from interface org.apache.hc.core5.http.MessageHeaders
containsHeader, countHeaders, getFirstHeader, getHeader, getHeaders, getHeaders, getLastHeader, headerIterator, headerIterator
-
Constructor Details
-
HttpResponseWrapper
-
-
Method Details
-
getCode
public int getCode()Description copied from interface:HttpResponseObtains the code of this response message.- Specified by:
getCodein interfaceHttpResponse- Returns:
- the status code.
-
setCode
public void setCode(int code) Description copied from interface:HttpResponseUpdates status code of this response message.- Specified by:
setCodein interfaceHttpResponse- Parameters:
code- the HTTP status code.- See Also:
-
getReasonPhrase
Description copied from interface:HttpResponseObtains the reason phrase of this response if available.- Specified by:
getReasonPhrasein interfaceHttpResponse- Returns:
- the reason phrase.
-
setReasonPhrase
Description copied from interface:HttpResponseUpdates the status line of this response with a new reason phrase.- Specified by:
setReasonPhrasein interfaceHttpResponse- Parameters:
reason- the new reason phrase as a single-line string, ornullto unset the reason phrase
-
getLocale
Description copied from interface:HttpResponseObtains the locale of this response. The locale is used to determine the reason phrase for thestatus code. It can be changed usingsetLocale.- Specified by:
getLocalein interfaceHttpResponse- Returns:
- the locale of this response, never
null
-
setLocale
Description copied from interface:HttpResponseChanges the locale of this response.- Specified by:
setLocalein interfaceHttpResponse- Parameters:
loc- the new locale
-