public class RetrofitHelper
extends java.lang.Object
Constructor and Description |
---|
RetrofitHelper() |
Modifier and Type | Method and Description |
---|---|
void |
cancelPendingRequests()
To cancel all pending requests.
|
void |
dequeue(boolean all)
Dequeue Search Calls
|
boolean |
enqueue(retrofit2.Call call,
Params params,
long requestTimeInMillis)
Enqueue Search Call
|
OnSearchResult |
getListener() |
void |
removeListener()
Remove listener
|
void |
setListener(OnSearchResult listener)
Set/Register listener implemented in your class to have Search callbacks
|
public boolean enqueue(retrofit2.Call call, Params params, long requestTimeInMillis)
boolean
true if enqueued successfullypublic void dequeue(boolean all)
all
- if true then it will dequeue all pending requests by calling the interface's callback method
OnSearchResult.onSearchRequestCancel(Params, long)
, and in case of false it will only cancel the most recent
requestpublic void cancelPendingRequests()
OnSearchResult.onSearchRequestCancel(Params, long)
only when the listener is registered through setListener(OnSearchResult)
public void setListener(OnSearchResult listener)
listener
- Reference of OnSearchResult
's interfacepublic OnSearchResult getListener()
public void removeListener()