Class HttpResponseException.Builder (1.43.1)

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
NameDescription
responseHttpResponse

HTTP response

Builder(int statusCode, String statusMessage, HttpHeaders headers)

public Builder(int statusCode, String statusMessage, HttpHeaders headers)
Parameters
NameDescription
statusCodeint

HTTP status code

statusMessageString

status message or null

headersHttpHeaders

HTTP headers

Methods

build()

public HttpResponseException build()

Returns a new instance of HttpResponseException based on this builder.

Returns
TypeDescription
HttpResponseException

getAttemptCount()

public final int getAttemptCount()

Returns the request attempt count

Returns
TypeDescription
int

getContent()

public final String getContent()

Returns the HTTP response content or null for none.

Returns
TypeDescription
String

getHeaders()

public HttpHeaders getHeaders()

Returns the HTTP response headers.

Returns
TypeDescription
HttpHeaders

getMessage()

public final String getMessage()

Returns the detail message to use or null for none.

Returns
TypeDescription
String

getStatusCode()

public final int getStatusCode()

Returns the HTTP status code or 0 for none.

Returns
TypeDescription
int

getStatusMessage()

public final String getStatusMessage()

Returns the HTTP status message or null for none.

Returns
TypeDescription
String

setAttemptCount(int attemptCount)

public HttpResponseException.Builder setAttemptCount(int attemptCount)

Sets the attempt count for the related HTTP request execution.

Parameter
NameDescription
attemptCountint
Returns
TypeDescription
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
NameDescription
contentString
Returns
TypeDescription
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
NameDescription
headersHttpHeaders
Returns
TypeDescription
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
NameDescription
messageString
Returns
TypeDescription
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
NameDescription
statusCodeint
Returns
TypeDescription
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
NameDescription
statusMessageString
Returns
TypeDescription
HttpResponseException.Builder