目录

HttpResponseException.Builder

Class Info

public static class Builder

Builder object for an HTTP response exception.

Public Constructor Summary

Constructor Name

public Builder(int statusCode, String statusMessage, HttpHeaders headers)

Constructs a Builder object.

public Builder(HttpResponse response)

Constructs a Builder object.

Public Method Summary

Qualifier and Type

Method Name and Description

HttpResponseException

build()

Creates an HttpResponseException instance.

final String

getContent()

Obtains the HTTP response content.

Builder

setContent()

Sets the HTTP response content.

Builder

setError(ErrorResponse error)

Sets the error response object.

ErrorResponse

getError()

Obtains the error response object.

Builder

setHeaders(HttpHeaders headers)

Sets headers in the HTTP response.

HttpHeaders

getHeaders()

Obtains headers in the HTTP response.

final String

getMessage()

Obtains the detailed information.

Builder

setMessage(String message)

Sets the detailed information.

final int

getStatusCode()

Obtains the HTTP status code.

Builder

setStatusCode(int statusCode)

Sets the HTTP status code.

final String

getStatusMessage()

Obtains the HTTP status information.

Builder

setStatusMessage(String statusMessage )

Sets the HTTP status information.

Public Constructors

[h2]Builder

Constructor

public Builder(int statusCode, String statusMessage, HttpHeaders headers)

Constructs a Builder object.

Parameters

Name

Description

statusCode

HTTP status code.

statusMessage

HTTP status information.

headers

HTTP response headers.

[h2]Builder

Constructor

public Builder(HttpResponse response)

Constructs a Builder object.

Parameters

Name

Description

response

HTTP response.

Public Methods

[h2]build

Method

public HttpResponseException build()

Creates an HttpResponseException instance.

Returns

Type

Description

HttpResponseException

HttpResponseException instance.

[h2]getContent

Method

public final String getContent()

Obtains the HTTP response content.

Returns

Type

Description

final String

HTTP response content.

[h2]setContent

Method

public Builder setContent(String content)

Sets the HTTP response content.

Parameters

Name

Description

content

HTTP response content.

Returns

Type

Description

Builder

Builder object.

[h2]setError

Method

public Builder setError(ErrorResponse error)

Sets the error response object.

Parameters

Name

Description

error

Error response.

Returns

Type

Description

Builder

Builder object.

[h2]getError

Method

public ErrorResponse getError()

Obtains the error response object.

Returns

Type

Description

ErrorResponse

Error response object.

[h2]setError

Method

public Builder setError(ErrorResponse error)

Sets the error response object.

Parameters

Name

Description

error

Error response.

Returns

Type

Description

Builder

Builder object.

[h2]setHeaders

Method

public Builder setHeaders(HttpHeaders headers)

Sets headers in the HTTP response.

Parameters

Name

Description

headers

Headers in the HTTP response.

Returns

Type

Description

Builder

Builder object.

[h2]getHeaders

Method

public HttpHeaders getHeaders()

Obtains headers in the HTTP response.

Returns

Type

Description

HttpHeaders

Headers in the HTTP response.

[h2]getMessage

Method

public final String getMessage()

Obtains the detailed information.

Returns

Type

Description

final String

Detailed information.

[h2]setMessage

Method

public Builder setMessage(String message)

Sets the detailed information.

Parameters

Name

Description

message

Detailed information.

Returns

Type

Description

Builder

Builder object.

[h2]getStatusCode

Method

public final int getStatusCode()

Obtains the HTTP status code.

Returns

Type

Description

final int

HTTP status code.

[h2]setStatusCode

Method

public Builder setStatusCode(int statusCode)

Sets the HTTP status code.

Parameters

Name

Description

statusCode

HTTP status code.

Returns

Type

Description

Builder

Builder object.

[h2]getStatusMessage

Method

public final String getStatusMessage()

Obtains the HTTP status information.

Returns

Type

Description

final String

HTTP status information.

[h2]setStatusMessage

Method

public Builder setStatusMessage(String statusMessage)

Sets the HTTP status information.

Parameters

Name

Description

statusMessage

HTTP status information.

Returns

Type

Description

Builder

Builder object.