public abstract class ApiResponse<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected javax.ws.rs.core.Response |
response |
protected static String |
STATUS |
protected static String |
STATUS_OK |
| Constructor and Description |
|---|
ApiResponse() |
| Modifier and Type | Method and Description |
|---|---|
protected ApiResponse<Boolean> |
checkStatusOK()
a convenience function for checking the standard OK response from the web
service.
|
String |
getEtag() |
javax.ws.rs.core.Response |
getRawResponse() |
boolean |
hasError() |
static <T> ApiResponse<T> |
of(javax.ws.rs.core.Response response,
Class<T> entityClass) |
static <T> ApiResponse<T> |
of(javax.ws.rs.core.Response response,
javax.ws.rs.core.GenericType<T> genericType) |
static <T> ApiResponse<T> |
of(javax.ws.rs.core.Response response,
T data) |
abstract T |
readEntity() |
ApiError |
readError() |
protected final javax.ws.rs.core.Response response
protected static final String STATUS
protected static final String STATUS_OK
public abstract T readEntity()
public ApiError readError()
public boolean hasError()
public javax.ws.rs.core.Response getRawResponse()
public String getEtag()
protected ApiResponse<Boolean> checkStatusOK()
apiResponse - public static <T> ApiResponse<T> of(javax.ws.rs.core.Response response, Class<T> entityClass)
public static <T> ApiResponse<T> of(javax.ws.rs.core.Response response, javax.ws.rs.core.GenericType<T> genericType)
public static <T> ApiResponse<T> of(javax.ws.rs.core.Response response, T data)
Copyright © 2018. All rights reserved.