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 anHttpResponse
.HttpResponse
wrapper.
-
-
Constructor Summary
Constructors Constructor Description HttpResponseWrapper(HttpResponse message)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCode()
Obtains the code of this response message.java.util.Locale
getLocale()
Obtains the locale of this response.java.lang.String
getReasonPhrase()
Obtains the reason phrase of this response if available.void
setCode(int code)
Updates status code of this response message.void
setLocale(java.util.Locale loc)
Changes the locale of this response.void
setReasonPhrase(java.lang.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, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.hc.core5.http.HttpMessage
addHeader, addHeader, getVersion, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setVersion
-
Methods inherited from interface org.apache.hc.core5.http.MessageHeaders
containsHeader, countHeaders, getFirstHeader, getHeader, getHeaders, getHeaders, getLastHeader, headerIterator, headerIterator
-
-
-
-
Constructor Detail
-
HttpResponseWrapper
public HttpResponseWrapper(HttpResponse message)
-
-
Method Detail
-
getCode
public int getCode()
Description copied from interface:HttpResponse
Obtains the code of this response message.- Specified by:
getCode
in interfaceHttpResponse
- Returns:
- the status code.
-
setCode
public void setCode(int code)
Description copied from interface:HttpResponse
Updates status code of this response message.- Specified by:
setCode
in interfaceHttpResponse
- Parameters:
code
- the HTTP status code.- See Also:
HttpStatus
-
getReasonPhrase
public java.lang.String getReasonPhrase()
Description copied from interface:HttpResponse
Obtains the reason phrase of this response if available.- Specified by:
getReasonPhrase
in interfaceHttpResponse
- Returns:
- the reason phrase.
-
setReasonPhrase
public void setReasonPhrase(java.lang.String reason)
Description copied from interface:HttpResponse
Updates the status line of this response with a new reason phrase.- Specified by:
setReasonPhrase
in interfaceHttpResponse
- Parameters:
reason
- the new reason phrase as a single-line string, ornull
to unset the reason phrase
-
getLocale
public java.util.Locale getLocale()
Description copied from interface:HttpResponse
Obtains the locale of this response. The locale is used to determine the reason phrase for thestatus code
. It can be changed usingsetLocale
.- Specified by:
getLocale
in interfaceHttpResponse
- Returns:
- the locale of this response, never
null
-
setLocale
public void setLocale(java.util.Locale loc)
Description copied from interface:HttpResponse
Changes the locale of this response.- Specified by:
setLocale
in interfaceHttpResponse
- Parameters:
loc
- the new locale
-
-