public class RestAdapter extends RestAdapter
RestAdapter
to make working with
Models easier.Adapter.Callback, Adapter.JsonArrayCallback, Adapter.JsonCallback, Adapter.JsonObjectCallback| Constructor and Description |
|---|
RestAdapter(android.content.Context context,
java.lang.String url) |
| Modifier and Type | Method and Description |
|---|---|
<U extends ModelRepository> |
createRepository(java.lang.Class<U> repositoryClass)
Creates a new
ModelRepository from the given subclass. |
ModelRepository<Model> |
createRepository(java.lang.String name)
Creates a new
ModelRepository representing the named model type. |
ModelRepository<Model> |
createRepository(java.lang.String name,
java.lang.String nameForRestUrl)
Creates a new
ModelRepository representing the named model type. |
<T extends Model> |
createRepository(java.lang.String name,
java.lang.String nameForRestUrl,
java.lang.Class<T> modelClass)
Creates a new
ModelRepository representing the named model type. |
connect, getContract, invokeInstanceMethod, invokeStaticMethod, isConnected, setContractpublic RestAdapter(android.content.Context context,
java.lang.String url)
public ModelRepository<Model> createRepository(java.lang.String name)
ModelRepository representing the named model type.name - The model name.public ModelRepository<Model> createRepository(java.lang.String name, java.lang.String nameForRestUrl)
ModelRepository representing the named model type.name - The model name.nameForRestUrl - The model name to use in REST URL, usually the plural form of `name`.public <T extends Model> ModelRepository<T> createRepository(java.lang.String name, java.lang.String nameForRestUrl, java.lang.Class<T> modelClass)
ModelRepository representing the named model type.name - The model name.nameForRestUrl - The model name to use in REST URL, usually the plural form of `name`.modelClass - The model class. The class must have a public
no-argument constructor.public <U extends ModelRepository> U createRepository(java.lang.Class<U> repositoryClass)
ModelRepository from the given subclass.repositoryClass - A subclass of ModelRepository to use.
The class must have a public no-argument constructor.