ServiceResponseWithHeaders<TBody,THeader> Class

Type Parameters

TBody

the type of the response

THeader

the type of the response header object

public final class ServiceResponseWithHeaders<TBody,THeader>
extends ServiceResponse<TBody>

An instance of this class holds a response object and a raw REST response.

Constructor Summary

Constructor Description
ServiceResponseWithHeaders(TBody body, THeader headers, Response<ResponseBody> response)

Instantiate a ServiceResponse instance with a response object and a raw REST response.

ServiceResponseWithHeaders(THeader headers, Response<Void> response)

Instantiate a ServiceResponse instance with a response object and a raw REST response.

Method Summary

Modifier and Type Method and Description
THeader headers()

Gets the response headers.

Methods inherited from ServiceResponse

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

ServiceResponseWithHeaders

public ServiceResponseWithHeaders(TBody body, THeader headers, Response response)

Instantiate a ServiceResponse instance with a response object and a raw REST response.

Parameters:

body - deserialized response object
headers - deserialized response header object
response - raw REST response

ServiceResponseWithHeaders

public ServiceResponseWithHeaders(THeader headers, Response response)

Instantiate a ServiceResponse instance with a response object and a raw REST response.

Parameters:

headers - deserialized response header object
response - raw REST response

Method Details

headers

public THeader headers()

Gets the response headers.

Returns:

the response headers. Null if there isn't one.

Applies to