public static class HttpResponseException.Builder extends Object
Implementation is not thread safe.
Constructor and Description |
---|
Builder(HttpResponse response) |
Builder(int statusCode,
String statusMessage,
HttpHeaders headers) |
Modifier and Type | Method and Description |
---|---|
HttpResponseException |
build()
Returns a new instance of
HttpResponseException based on this builder. |
String |
getContent()
Returns the HTTP response content or
null for none. |
HttpHeaders |
getHeaders()
Returns the HTTP response headers.
|
String |
getMessage()
Returns the detail message to use or
null for none. |
int |
getStatusCode()
Returns the HTTP status code or
0 for none. |
String |
getStatusMessage()
Returns the HTTP status message or
null for none. |
HttpResponseException.Builder |
setContent(String content)
Sets the HTTP response content or
null for none. |
HttpResponseException.Builder |
setHeaders(HttpHeaders headers)
Sets the HTTP response headers.
|
HttpResponseException.Builder |
setMessage(String message)
Sets the detail message to use or
null for none. |
HttpResponseException.Builder |
setStatusCode(int statusCode)
Sets the HTTP status code or
0 for none. |
HttpResponseException.Builder |
setStatusMessage(String statusMessage)
Sets the HTTP status message or
null for none. |
public Builder(int statusCode, String statusMessage, HttpHeaders headers)
statusCode
- HTTP status codestatusMessage
- status message or null
headers
- HTTP headerspublic Builder(HttpResponse response)
response
- HTTP responsepublic final String getMessage()
null
for none.public HttpResponseException.Builder setMessage(String message)
null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final int getStatusCode()
0
for none.public HttpResponseException.Builder setStatusCode(int statusCode)
0
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final String getStatusMessage()
null
for none.public HttpResponseException.Builder setStatusMessage(String statusMessage)
null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public HttpHeaders getHeaders()
public HttpResponseException.Builder setHeaders(HttpHeaders headers)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final String getContent()
null
for none.public HttpResponseException.Builder setContent(String content)
null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public HttpResponseException build()
HttpResponseException
based on this builder.Copyright © 2011–2020 Google. All rights reserved.