T
- the type of the responsepublic class ServiceResponse<T> extends Object
Constructor and Description |
---|
ServiceResponse(retrofit2.Response<Void> headResponse)
Instantiate a ServiceResponse instance with a response from a HEAD operation.
|
ServiceResponse(T body,
retrofit2.Response<okhttp3.ResponseBody> response)
Instantiate a ServiceResponse instance with a response object and a raw REST response.
|
Modifier and Type | Method and Description |
---|---|
T |
body()
Gets the response object.
|
retrofit2.Response<Void> |
headResponse()
Gets the raw REST response from a HEAD operation.
|
retrofit2.Response<okhttp3.ResponseBody> |
response()
Gets the raw REST response.
|
ServiceResponse<T> |
withBody(T body)
Sets the response object.
|
public ServiceResponse(T body, retrofit2.Response<okhttp3.ResponseBody> response)
body
- deserialized response objectresponse
- raw REST responsepublic ServiceResponse(retrofit2.Response<Void> headResponse)
headResponse
- raw REST response from a HEAD operationpublic T body()
public ServiceResponse<T> withBody(T body)
body
- the response object.public retrofit2.Response<okhttp3.ResponseBody> response()
public retrofit2.Response<Void> headResponse()
Copyright © 2019. All rights reserved.