Package com.google.api.client.http
Class HttpResponseException.Builder
- java.lang.Object
-
- com.google.api.client.http.HttpResponseException.Builder
-
- Enclosing class:
- HttpResponseException
public static class HttpResponseException.Builder extends Object
Builder.Implementation is not thread safe.
- Since:
- 1.14
-
-
Constructor Summary
Constructors Constructor Description Builder(int statusCode, String statusMessage, HttpHeaders headers)
Builder(HttpResponse response)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpResponseException
build()
Returns a new instance ofHttpResponseException
based on this builder.String
getContent()
Returns the HTTP response content ornull
for none.HttpHeaders
getHeaders()
Returns the HTTP response headers.String
getMessage()
Returns the detail message to use ornull
for none.int
getStatusCode()
Returns the HTTP status code or0
for none.String
getStatusMessage()
Returns the HTTP status message ornull
for none.HttpResponseException.Builder
setContent(String content)
Sets the HTTP response content ornull
for none.HttpResponseException.Builder
setHeaders(HttpHeaders headers)
Sets the HTTP response headers.HttpResponseException.Builder
setMessage(String message)
Sets the detail message to use ornull
for none.HttpResponseException.Builder
setStatusCode(int statusCode)
Sets the HTTP status code or0
for none.HttpResponseException.Builder
setStatusMessage(String statusMessage)
Sets the HTTP status message ornull
for none.
-
-
-
Constructor Detail
-
Builder
public Builder(int statusCode, String statusMessage, HttpHeaders headers)
- Parameters:
statusCode
- HTTP status codestatusMessage
- status message ornull
headers
- HTTP headers
-
Builder
public Builder(HttpResponse response)
- Parameters:
response
- HTTP response
-
-
Method Detail
-
getMessage
public final String getMessage()
Returns the detail message to use ornull
for none.
-
setMessage
public HttpResponseException.Builder setMessage(String message)
Sets the detail message to use ornull
for none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getStatusCode
public final int getStatusCode()
Returns the HTTP status code or0
for none.
-
setStatusCode
public HttpResponseException.Builder setStatusCode(int statusCode)
Sets the HTTP status code or0
for none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getStatusMessage
public final String getStatusMessage()
Returns the HTTP status message ornull
for none.
-
setStatusMessage
public HttpResponseException.Builder setStatusMessage(String statusMessage)
Sets the HTTP status message ornull
for none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getHeaders
public HttpHeaders getHeaders()
Returns the HTTP response headers.
-
setHeaders
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.
-
getContent
public final String getContent()
Returns the HTTP response content ornull
for none.
-
setContent
public HttpResponseException.Builder setContent(String content)
Sets the HTTP response content ornull
for none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
build
public HttpResponseException build()
Returns a new instance ofHttpResponseException
based on this builder.
-
-