public static class HttpResponseException.Builder
Builder.
Implementation is not thread safe.
Constructors
Builder(HttpResponse response)
public Builder(HttpResponse response)
Name | Description |
response | HttpResponse HTTP response |
Builder(int statusCode, String statusMessage, HttpHeaders headers)
public Builder(int statusCode, String statusMessage, HttpHeaders headers)
Name | Description |
statusCode | int HTTP status code |
statusMessage | String status message or |
headers | HttpHeaders HTTP headers |
Methods
build()
public HttpResponseException build()
Returns a new instance of HttpResponseException based on this builder.
Type | Description |
HttpResponseException |
getAttemptCount()
public final int getAttemptCount()
Returns the request attempt count
Type | Description |
int |
getContent()
public final String getContent()
Returns the HTTP response content or null
for none.
Type | Description |
String |
getHeaders()
public HttpHeaders getHeaders()
Returns the HTTP response headers.
Type | Description |
HttpHeaders |
getMessage()
public final String getMessage()
Returns the detail message to use or null
for none.
Type | Description |
String |
getStatusCode()
public final int getStatusCode()
Returns the HTTP status code or 0
for none.
Type | Description |
int |
getStatusMessage()
public final String getStatusMessage()
Returns the HTTP status message or null
for none.
Type | Description |
String |
setAttemptCount(int attemptCount)
public HttpResponseException.Builder setAttemptCount(int attemptCount)
Sets the attempt count for the related HTTP request execution.
Name | Description |
attemptCount | int |
Type | Description |
HttpResponseException.Builder |
setContent(String content)
public HttpResponseException.Builder setContent(String content)
Sets the HTTP response content or null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
content | String |
Type | Description |
HttpResponseException.Builder |
setHeaders(HttpHeaders headers)
public HttpResponseException.Builder setHeaders(HttpHeaders headers)
Sets the HTTP response headers.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
headers | HttpHeaders |
Type | Description |
HttpResponseException.Builder |
setMessage(String message)
public HttpResponseException.Builder setMessage(String message)
Sets the detail message to use or null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
message | String |
Type | Description |
HttpResponseException.Builder |
setStatusCode(int statusCode)
public HttpResponseException.Builder setStatusCode(int statusCode)
Sets the HTTP status code or 0
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
statusCode | int |
Type | Description |
HttpResponseException.Builder |
setStatusMessage(String statusMessage)
public HttpResponseException.Builder setStatusMessage(String statusMessage)
Sets the HTTP status message or null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
statusMessage | String |
Type | Description |
HttpResponseException.Builder |