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 java.lang.ObjectBuilder.Implementation is not thread safe.
- Since:
- 1.14
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.StringcontentResponse content ornullfor none.(package private) HttpHeadersheadersHTTP headers.(package private) java.lang.StringmessageDetail message to use ornullfor none.(package private) intstatusCodeHTTP status code.(package private) java.lang.StringstatusMessageStatus message ornull.
-
Constructor Summary
Constructors Constructor Description Builder(int statusCode, java.lang.String statusMessage, HttpHeaders headers)Builder(HttpResponse response)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpResponseExceptionbuild()Returns a new instance ofHttpResponseExceptionbased on this builder.java.lang.StringgetContent()Returns the HTTP response content ornullfor none.HttpHeadersgetHeaders()Returns the HTTP response headers.java.lang.StringgetMessage()Returns the detail message to use ornullfor none.intgetStatusCode()Returns the HTTP status code or0for none.java.lang.StringgetStatusMessage()Returns the HTTP status message ornullfor none.HttpResponseException.BuildersetContent(java.lang.String content)Sets the HTTP response content ornullfor none.HttpResponseException.BuildersetHeaders(HttpHeaders headers)Sets the HTTP response headers.HttpResponseException.BuildersetMessage(java.lang.String message)Sets the detail message to use ornullfor none.HttpResponseException.BuildersetStatusCode(int statusCode)Sets the HTTP status code or0for none.HttpResponseException.BuildersetStatusMessage(java.lang.String statusMessage)Sets the HTTP status message ornullfor none.
-
-
-
Field Detail
-
statusCode
int statusCode
HTTP status code.
-
statusMessage
java.lang.String statusMessage
Status message ornull.
-
headers
HttpHeaders headers
HTTP headers.
-
content
java.lang.String content
Response content ornullfor none.
-
message
java.lang.String message
Detail message to use ornullfor none.
-
-
Constructor Detail
-
Builder
public Builder(int statusCode, java.lang.String statusMessage, HttpHeaders headers)- Parameters:
statusCode- HTTP status codestatusMessage- status message ornullheaders- HTTP headers
-
Builder
public Builder(HttpResponse response)
- Parameters:
response- HTTP response
-
-
Method Detail
-
getMessage
public final java.lang.String getMessage()
Returns the detail message to use ornullfor none.
-
setMessage
public HttpResponseException.Builder setMessage(java.lang.String message)
Sets the detail message to use ornullfor 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 or0for none.
-
setStatusCode
public HttpResponseException.Builder setStatusCode(int statusCode)
Sets the HTTP status code or0for none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getStatusMessage
public final java.lang.String getStatusMessage()
Returns the HTTP status message ornullfor none.
-
setStatusMessage
public HttpResponseException.Builder setStatusMessage(java.lang.String statusMessage)
Sets the HTTP status message ornullfor 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 java.lang.String getContent()
Returns the HTTP response content ornullfor none.
-
setContent
public HttpResponseException.Builder setContent(java.lang.String content)
Sets the HTTP response content ornullfor 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 ofHttpResponseExceptionbased on this builder.
-
-