| Modifier and Type | Field and Description |
|---|---|
static Executor |
THREAD_POOL_EXECUTOR |
| Constructor and Description |
|---|
RestAdapter(Class<T> klass,
URL baseURL) |
RestAdapter(Class<T> klass,
URL baseURL,
PipeConfig config) |
| 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()
|
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 id,
Callback<Void> callback)
Removes an object from the underlying server connection.
|
void |
save(T data,
Callback<T> callback)
Saves or updates a given object on the server.
|
public static final Executor THREAD_POOL_EXECUTOR
public RestAdapter(Class<T> klass, URL baseURL, PipeConfig config)
public 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 read(Callback<List<T>> callback)
public void save(T data, Callback<T> callback)
Pipepublic void remove(String id, Callback<Void> callback)
public 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>Copyright © 2013 JBoss by Red Hat. All Rights Reserved.