public class AsyncCustomEndpoints<I extends GenericJson,O>
Wraps the com.kinvey.java.CustomEndpoints public methods in asynchronous functionality using native Android AsyncTask.
NOTE: It is the responsibility of the user to either use a interface KinveyListCallback
or
a com.kinvey.java.core.KinveyClientCallback depending on what their Custom Endpoint returns.
Sample usage:
The above sample assumes the Custom Endpoint takes no input null
and returns an array of JSON objects.
interface KinveyListCallback
Modifier and Type | Class and Description |
---|---|
static class |
AsyncCustomEndpoints.AsyncCommand<I extends GenericJson,O> |
static class |
AsyncCustomEndpoints.AsyncCommandArray<I extends GenericJson,O> |
Constructor and Description |
---|
AsyncCustomEndpoints(com.kinvey.java.AbstractClient<?> client)
Deprecated.
|
AsyncCustomEndpoints(java.lang.Class<O> responseClass,
com.kinvey.java.AbstractClient<?> client)
Constructor for this Asyncronous Custom Endpoint class
|
Modifier and Type | Method and Description |
---|---|
void |
callEndpoint(java.lang.String commandName,
I input,
com.kinvey.java.core.KinveyClientCallback<O> callback)
Execute a Custom Endpoint which will return a single JSON object
|
void |
callEndpoint(java.lang.String commandName,
I input,
KinveyListCallback<O> callback)
Execute a Custom Endpoint which will return an array of JSON objects.
|
public AsyncCustomEndpoints(com.kinvey.java.AbstractClient<?> client)
Constructor for this Asyncronous Custom Endpoint class
client
- public AsyncCustomEndpoints(java.lang.Class<O> responseClass, com.kinvey.java.AbstractClient<?> client)
Constructor for this Asyncronous Custom Endpoint class
responseClass
- the class of the expected resposne objectclient
- an active logged in clientpublic void callEndpoint(java.lang.String commandName, I input, com.kinvey.java.core.KinveyClientCallback<O> callback)
Execute a Custom Endpoint which will return a single JSON object
commandName
- the name of the Command to execute
input
- any required input, can be null
callback
- get results of the command as a single JSON object
public void callEndpoint(java.lang.String commandName, I input, KinveyListCallback<O> callback)
Execute a Custom Endpoint which will return an array of JSON objects.
commandName
- the name of the Command to execute
input
- any required input, can be null
callback
- get results of the command as an array of JSON objects.