Package net.gini.android
Class RequestTaskCompletionSource<T>
- java.lang.Object
-
- net.gini.android.RequestTaskCompletionSource<T>
-
- Type Parameters:
T
- The response type of the request.
- All Implemented Interfaces:
com.android.volley.Response.ErrorListener
,com.android.volley.Response.Listener<T>
public class RequestTaskCompletionSource<T> extends java.lang.Object implements com.android.volley.Response.Listener<T>, com.android.volley.Response.ErrorListener
Handy class to wrap Bolt's tasks around a volley request. Can be used as both the response listener and error listener of a volley request.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description bolts.Task<T>
getTask()
Returns the task which will be completed by this completion source.static <T> RequestTaskCompletionSource<T>
newCompletionSource()
void
onErrorResponse(com.android.volley.VolleyError error)
void
onResponse(T response)
-
-
-
Method Detail
-
newCompletionSource
public static <T> RequestTaskCompletionSource<T> newCompletionSource()
-
getTask
public bolts.Task<T> getTask()
Returns the task which will be completed by this completion source.
-
onResponse
public void onResponse(T response)
- Specified by:
onResponse
in interfacecom.android.volley.Response.Listener<T>
-
onErrorResponse
public void onErrorResponse(com.android.volley.VolleyError error)
- Specified by:
onErrorResponse
in interfacecom.android.volley.Response.ErrorListener
-
-