Request.Method, Request.Priority
Modifier and Type | Field and Description |
---|---|
private java.lang.Class<T> |
mClazz |
private com.google.gson.Gson |
mGson |
private Response.Listener<T> |
mListener |
Constructor and Description |
---|
GsonRequest(int method,
java.lang.String url,
java.lang.Class<T> clazz,
Response.Listener<T> listener,
Response.ErrorListener errorListener) |
GsonRequest(int method,
java.lang.String url,
java.lang.Class<T> clazz,
Response.Listener<T> listener,
Response.ErrorListener errorListener,
com.google.gson.Gson gson) |
Modifier and Type | Method and Description |
---|---|
protected void |
deliverResponse(T response)
Subclasses must implement this to perform delivery of the parsed
response to their listeners.
|
protected Response<T> |
parseNetworkResponse(NetworkResponse response)
Subclasses must implement this to parse the raw network response
and return an appropriate response type.
|
addMarker, cancel, compareTo, deliverError, getBody, getBodyContentType, getCacheEntry, getCacheKey, getHeaders, getMethod, getParams, getParamsEncoding, getPostBody, getPostBodyContentType, getPostParams, getPostParamsEncoding, getPriority, getRetryPolicy, getSequence, getTag, getTimeoutMs, getTrafficStatsTag, getUrl, hasHadResponseDelivered, isCanceled, markDelivered, parseNetworkError, setCacheEntry, setRequestQueue, setRetryPolicy, setSequence, setShouldCache, setTag, shouldCache, toString
private final com.google.gson.Gson mGson
private final java.lang.Class<T> mClazz
private final Response.Listener<T> mListener
public GsonRequest(int method, java.lang.String url, java.lang.Class<T> clazz, Response.Listener<T> listener, Response.ErrorListener errorListener)
public GsonRequest(int method, java.lang.String url, java.lang.Class<T> clazz, Response.Listener<T> listener, Response.ErrorListener errorListener, com.google.gson.Gson gson)
protected void deliverResponse(T response)
Request
deliverResponse
in class Request<T>
response
- The parsed response returned by
Request.parseNetworkResponse(NetworkResponse)
protected Response<T> parseNetworkResponse(NetworkResponse response)
Request
parseNetworkResponse
in class Request<T>
response
- Response from the network