@ThreadSafe @Immutable @LevelUpApi(contract=PUBLIC) public final class LevelUpResponse extends BufferedResponse implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>| Modifier and Type | Field and Description |
|---|---|
static Parcelable.Creator<LevelUpResponse> |
CREATOR
Creator for parceling.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE| Constructor and Description |
|---|
LevelUpResponse(LevelUpStatus status,
LevelUpResponse originalResponse) |
LevelUpResponse(Parcel in)
Constructor for parceling.
|
LevelUpResponse(String data,
LevelUpStatus status) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Exception |
getError()
Get the error that occurred during the sending of the request OR during the reading of the
response.
|
Error |
getServerError(ErrorObject object,
ErrorCode code)
Get a specific
Error from the LevelUpResponse which contains specific values
for Error.getObject() and Error.getCode(). |
List<Error> |
getServerErrors() |
LevelUpStatus |
getStatus() |
int |
hashCode() |
boolean |
hasServerErrors() |
String |
toString() |
void |
writeToParcel(Parcel dest,
int flags) |
describeContents, getDatagetHttpHeader, getHttpHeaders, getHttpStatusCodeclone, finalize, getClass, notify, notifyAll, wait, wait, waitdescribeContentspublic static final Parcelable.Creator<LevelUpResponse> CREATOR
public LevelUpResponse(String data, LevelUpStatus status)
data - the string data (typically JSON) from the response from the server.status - the status of the response. See LevelUpStatus.public LevelUpResponse(LevelUpStatus status, LevelUpResponse originalResponse)
status - the status of the response. See LevelUpStatus.originalResponse - the original response the server gavepublic LevelUpResponse(Parcel in)
in - the parcel to read from.public LevelUpStatus getStatus()
LevelUpStatus for this LevelUpResponse.public List<Error> getServerErrors()
Errors on this server response. Will attempt to parse the
Errors from the BufferedResponse.getData() if the errors are not already populated.public boolean hasServerErrors()
public Error getServerError(ErrorObject object, ErrorCode code)
Error from the LevelUpResponse which contains specific values
for Error.getObject() and Error.getCode().object - the ErrorObject of the desired error. This object is scoped to the
context of the web service.code - the ErrorCode of the desired error.Error or null if the error is not found.public Exception getError()
BufferedResponsegetError in class BufferedResponsepublic String toString()
toString in class BufferedResponsepublic void writeToParcel(Parcel dest, int flags)
writeToParcel in interface ParcelablewriteToParcel in class BufferedResponse