public class Response<DataType>
extends java.lang.Object
implements android.os.Parcelable
| Modifier and Type | Field and Description |
|---|---|
DataType |
body |
static android.os.Parcelable.Creator<Response> |
CREATOR |
| Constructor and Description |
|---|
Response(byte[] data) |
| Modifier and Type | Method and Description |
|---|---|
void |
assertCodeRetEquals(byte codeRet) |
DataType |
body() |
<T> T |
body(BodyConverter<T> decoder) |
byte |
codeRet() |
static <T> Response<T> |
create(byte codeRet,
T data) |
int |
describeContents() |
boolean |
equals(java.lang.Object o) |
static Response<byte[]> |
ERROR(byte errorCode) |
static <T> Response<T> |
GET(T data) |
boolean |
hasBody() |
int |
hashCode() |
boolean |
isSuccessful() |
byte[] |
rawBody() |
void |
setBody(DataType body) |
void |
setDecoder(BodyConverter<DataType> decoder) |
static Response |
SUCCESS() |
static <T> Response<T> |
SUCCESS(T data) |
byte[] |
toBytes() |
java.lang.String |
toString() |
void |
writeToParcel(android.os.Parcel parcel,
int i) |
@Nullable public DataType body
public static final android.os.Parcelable.Creator<Response> CREATOR
public DataType body() throws ResponseError
ResponseErrorpublic <T> T body(BodyConverter<T> decoder)
@Nullable public byte[] rawBody()
public boolean hasBody()
public byte codeRet()
public java.lang.String toString()
toString in class java.lang.Objectpublic byte[] toBytes()
public void setBody(DataType body)
public boolean isSuccessful()
public void setDecoder(BodyConverter<DataType> decoder)
public static <T> Response<T> create(byte codeRet, T data)
public static <T> Response<T> SUCCESS(T data)
public static Response SUCCESS()
public static Response<byte[]> ERROR(byte errorCode)
public static <T> Response<T> GET(T data)
public void assertCodeRetEquals(byte codeRet)
throws UnexpectedCodeRetException
UnexpectedCodeRetExceptionpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int describeContents()
describeContents in interface android.os.Parcelablepublic void writeToParcel(android.os.Parcel parcel,
int i)
writeToParcel in interface android.os.Parcelable