Class HttpResponseException.Builder (1.43.2)

public static class HttpResponseException.Builder

Builder.

Implementation is not thread safe.

Inheritance

java.lang.Object > HttpResponseException.Builder

Constructors

Builder(HttpResponse response)

public Builder(HttpResponse response)
Parameter
Name Description
response HttpResponse

HTTP response

Builder(int statusCode, String statusMessage, HttpHeaders headers)

public Builder(int statusCode, String statusMessage, HttpHeaders headers)
Parameters
Name Description
statusCode int

HTTP status code

statusMessage String

status message or null

headers HttpHeaders

HTTP headers

Methods

build()

public HttpResponseException build()

Returns a new instance of HttpResponseException based on this builder.

Returns
Type Description
HttpResponseException

getAttemptCount()

public final int getAttemptCount()

Returns the request attempt count

Returns
Type Description
int

getContent()

public final String getContent()

Returns the HTTP response content or null for none.

Returns
Type Description
String

getHeaders()

public HttpHeaders getHeaders()

Returns the HTTP response headers.

Returns
Type Description
HttpHeaders

getMessage()

public final String getMessage()

Returns the detail message to use or null for none.

Returns
Type Description
String

getStatusCode()

public final int getStatusCode()

Returns the HTTP status code or 0 for none.

Returns
Type Description
int

getStatusMessage()

public final String getStatusMessage()

Returns the HTTP status message or null for none.

Returns
Type Description
String

setAttemptCount(int attemptCount)

public HttpResponseException.Builder setAttemptCount(int attemptCount)

Sets the attempt count for the related HTTP request execution.

Parameter
Name Description
attemptCount int
Returns
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.

Parameter
Name Description
content String
Returns
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.

Parameter
Name Description
headers HttpHeaders
Returns
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.

Parameter
Name Description
message String
Returns
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.

Parameter
Name Description
statusCode int
Returns
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.

Parameter
Name Description
statusMessage String
Returns
Type Description
HttpResponseException.Builder