public class SupportLoaderAdapter<T> extends Object implements LoaderPipe<T>, android.support.v4.app.LoaderManager.LoaderCallbacks<T>
LoaderAdapter| Constructor and Description |
|---|
SupportLoaderAdapter(android.support.v4.app.FragmentActivity activity,
Pipe<T> pipe,
com.google.gson.Gson gson,
String name) |
SupportLoaderAdapter(android.support.v4.app.Fragment fragment,
android.content.Context applicationContext,
Pipe<T> pipe,
com.google.gson.Gson gson,
String name) |
| Modifier and Type | Method and Description |
|---|---|
com.google.gson.Gson |
getGson()
Returns the GSON serializer used to serialized instances of objects.
|
PipeHandler<T> |
getHandler()
Returns the instance which is responsible for handling read, save, and remove.
|
Class<T> |
getKlass() |
PipeType |
getType()
Returns the connection type of this
Pipe object (e.g. |
URL |
getUrl()
|
android.support.v4.content.Loader<T> |
onCreateLoader(int id,
android.os.Bundle bundle) |
void |
onLoaderReset(android.support.v4.content.Loader<T> loader) |
void |
onLoadFinished(android.support.v4.content.Loader<T> loader,
T data) |
void |
read(Callback<List<T>> callback)
Sends a signal to the Pipe to read its data and return it via the callback.
|
void |
readWithFilter(ReadFilter filter,
Callback<List<T>> callback)
Reads all the data from the underlying server connection.
|
void |
remove(String toRemoveId,
Callback<Void> callback)
Removes an object from the underlying server connection.
|
void |
reset()
Calls reset on all loaders associated with this pipe.
|
void |
save(T item,
Callback<T> callback)
Saves or updates a given object on the server.
|
void |
setLoaderIds(com.google.common.collect.Multimap<String,Integer> idsForNamedPipes)
Passes in a multimap of ids for the named pipe.
|
public SupportLoaderAdapter(android.support.v4.app.FragmentActivity activity,
Pipe<T> pipe,
com.google.gson.Gson gson,
String name)
public PipeType getType()
PipePipe object (e.g. REST).public void read(Callback<List<T>> callback)
Pipepublic void readWithFilter(ReadFilter filter, Callback<List<T>> callback)
PipereadWithFilter in interface Pipe<T>filter - a ReadFilter for performing pagination and querying.callback - The callback for consuming the result from the Pipe invocation.public void save(T item, Callback<T> callback)
Pipepublic void remove(String toRemoveId, Callback<Void> callback)
Pipepublic PipeHandler<T> getHandler()
PipegetHandler in interface Pipe<T>public android.support.v4.content.Loader<T> onCreateLoader(int id, android.os.Bundle bundle)
onCreateLoader in interface android.support.v4.app.LoaderManager.LoaderCallbacks<T>public com.google.gson.Gson getGson()
Pipepublic void onLoadFinished(android.support.v4.content.Loader<T> loader, T data)
onLoadFinished in interface android.support.v4.app.LoaderManager.LoaderCallbacks<T>public void onLoaderReset(android.support.v4.content.Loader<T> loader)
onLoaderReset in interface android.support.v4.app.LoaderManager.LoaderCallbacks<T>public void reset()
LoaderPipereset in interface LoaderPipe<T>public void setLoaderIds(com.google.common.collect.Multimap<String,Integer> idsForNamedPipes)
LoaderPipesetLoaderIds in interface LoaderPipe<T>Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.