public class LoaderAdapter<T> extends Object implements LoaderPipe<T>, android.app.LoaderManager.LoaderCallbacks<HeaderAndBody>
SupportLoaderAdapter| Constructor and Description |
|---|
LoaderAdapter(android.app.Activity activity,
Pipe<T> pipe,
com.google.gson.Gson gson,
String name)
Deprecated.
|
LoaderAdapter(android.app.Activity activity,
Pipe<T> pipe,
String name) |
LoaderAdapter(android.app.Fragment fragment,
android.content.Context applicationContext,
Pipe<T> pipe,
com.google.gson.Gson gson,
String name)
Deprecated.
|
LoaderAdapter(android.app.Fragment fragment,
android.content.Context applicationContext,
Pipe<T> pipe,
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() |
RequestBuilder<T> |
getRequestBuilder()
The
RequestBuilder is responsible for turning objects in bodies of requests. |
ResponseParser<T> |
getResponseParser()
The
ResponseParser is responsible for turning responses from a SAVE into an object |
PipeType |
getType()
Returns the connection type of this
Pipe object (e.g. |
URL |
getUrl()
|
android.content.Loader<HeaderAndBody> |
onCreateLoader(int id,
android.os.Bundle bundle) |
void |
onLoaderReset(android.content.Loader<HeaderAndBody> loader) |
void |
onLoadFinished(android.content.Loader<HeaderAndBody> loader,
HeaderAndBody data) |
void |
read(Callback<List<T>> callback)
Sends a signal to the Pipe to read its data and return it via the callback.
|
void |
read(ReadFilter filter,
Callback<List<T>> callback)
Reads all the data from the underlying server connection.
|
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.
|
@Deprecated public LoaderAdapter(android.app.Activity activity, Pipe<T> pipe, com.google.gson.Gson gson, String name)
@Deprecated public LoaderAdapter(android.app.Fragment fragment, android.content.Context applicationContext, 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 read(ReadFilter filter, Callback<List<T>> callback)
Piperead 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 com.google.gson.Gson getGson()
Pipepublic RequestBuilder<T> getRequestBuilder()
PipeRequestBuilder is responsible for turning objects in bodies of requests.getRequestBuilder in interface Pipe<T>public ResponseParser<T> getResponseParser()
PipeResponseParser is responsible for turning responses from a SAVE into an objectgetResponseParser in interface Pipe<T>public android.content.Loader<HeaderAndBody> onCreateLoader(int id, android.os.Bundle bundle)
onCreateLoader in interface android.app.LoaderManager.LoaderCallbacks<HeaderAndBody>public void onLoadFinished(android.content.Loader<HeaderAndBody> loader, HeaderAndBody data)
onLoadFinished in interface android.app.LoaderManager.LoaderCallbacks<HeaderAndBody>public void onLoaderReset(android.content.Loader<HeaderAndBody> loader)
onLoaderReset in interface android.app.LoaderManager.LoaderCallbacks<HeaderAndBody>public void reset()
LoaderPipereset in interface LoaderPipe<T>public void setLoaderIds(com.google.common.collect.Multimap<String,Integer> idsForNamedPipes)
LoaderPipesetLoaderIds in interface LoaderPipe<T>idsForNamedPipes - A map of all LoaderIds for pipes hased by their nameCopyright © 2014 JBoss by Red Hat. All rights reserved.