public class GSResponse
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
headers |
| Modifier | Constructor and Description |
|---|---|
|
GSResponse(java.lang.String method,
GSObject params,
int errorCode,
GSLogger traceSoFar) |
|
GSResponse(java.lang.String method,
GSObject params,
int errorCode,
java.lang.String errorMessage,
GSLogger traceSoFar) |
|
GSResponse(java.lang.String method,
GSObject params,
int errorCode,
java.lang.String errorMessage,
java.lang.String errorDetails,
GSLogger traceSoFar) |
protected |
GSResponse(java.lang.String method,
java.lang.String responseText,
GSLogger traceSoFar) |
| Modifier and Type | Method and Description |
|---|---|
GSArray |
getArray(java.lang.String key,
GSArray defaultValue)
Returns the GSArray value to which the specified key is mapped, or the defaultValue if this dictionary contains no mapping for the key.
|
boolean |
getBool(java.lang.String key,
boolean defaultValue)
Returns the boolean value to which the specified key is mapped, or the defaultValue if this dictionary contains no mapping for the key.
|
GSObject |
getData()
Returns the response data in GSObject.
|
double |
getDouble(java.lang.String key,
double defaultValue)
Returns the double value to which the specified key is mapped, or the defaultValue if this dictionary contains no mapping for the key.
|
int |
getErrorCode()
Returns the result code of the operation.
|
java.lang.String |
getErrorDetails()
Returns a description of the response error, for logging purposes.
|
java.lang.String |
getErrorMessage()
Returns a short textual description of the response error, for logging purposes.
|
static java.lang.String |
getErrorMessage(int errorCode) |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getHeaders() |
int |
getInt(java.lang.String key,
int defaultValue)
Returns the int value to which the specified key is mapped, or the defaultValue if this dictionary contains no mapping for the key.
|
java.lang.String |
getLog() |
long |
getLong(java.lang.String key,
long defaultValue)
Returns the long value to which the specified key is mapped, or the defaultValue if this dictionary contains no mapping for the key.
|
GSObject |
getObject(java.lang.String key,
GSObject defaultValue)
Returns the GSObject value to which the specified key is mapped, or the defaultValue if this dictionary contains no mapping for the key.
|
java.lang.String |
getResponseText()
Returns the raw response data.
|
java.lang.String |
getString(java.lang.String key,
java.lang.String defaultValue)
Returns the String value to which the specified key is mapped, or the defaultValue if this dictionary contains no mapping for the key.
|
boolean |
hasData() |
java.lang.String |
toString() |
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers
public GSResponse(java.lang.String method,
GSObject params,
int errorCode,
GSLogger traceSoFar)
public GSResponse(java.lang.String method,
GSObject params,
int errorCode,
java.lang.String errorMessage,
GSLogger traceSoFar)
public GSResponse(java.lang.String method,
GSObject params,
int errorCode,
java.lang.String errorMessage,
java.lang.String errorDetails,
GSLogger traceSoFar)
protected GSResponse(java.lang.String method,
java.lang.String responseText,
GSLogger traceSoFar)
public int getErrorCode()
public java.lang.String getErrorMessage()
public java.lang.String getErrorDetails()
public java.lang.String getResponseText()
public GSObject getData()
public boolean hasData()
public java.lang.String getLog()
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaders()
public boolean getBool(java.lang.String key,
boolean defaultValue)
key - the key whose associated value is to be returneddefaultValue - the boolean value to be returned if this dictionary doesn't contain the specified key.public int getInt(java.lang.String key,
int defaultValue)
key - the key whose associated value is to be returneddefaultValue - the int value to be returned if this dictionary doesn't contain the specified key.public long getLong(java.lang.String key,
long defaultValue)
key - the key whose associated value is to be returneddefaultValue - the long value to be returned if this dictionary doesn't contain the specified key.public double getDouble(java.lang.String key,
double defaultValue)
key - the key whose associated value is to be returneddefaultValue - the double value to be returned if this dictionary doesn't contain the specified key.public java.lang.String getString(java.lang.String key,
java.lang.String defaultValue)
key - the key whose associated value is to be returneddefaultValue - the String value to be returned if this dictionary doesn't contain the specified key.public GSObject getObject(java.lang.String key, GSObject defaultValue)
key - the key whose associated value is to be returneddefaultValue - the GSObject value to be returned if this dictionary doesn't contain the specified key.public GSArray getArray(java.lang.String key, GSArray defaultValue)
key - the key whose associated value is to be returneddefaultValue - the GSArray value to be returned if this dictionary doesn't contain the specified key.public java.lang.String toString()
toString in class java.lang.Objectpublic static java.lang.String getErrorMessage(int errorCode)