public class ProviderOperationsCompartment
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
ProviderOperationsCompartment(Cupboard cupboard,
java.util.ArrayList<android.content.ContentProviderOperation> operations) |
| Modifier and Type | Method and Description |
|---|---|
<T> ProviderOperationsCompartment |
delete(android.net.Uri uri,
T entity)
Add a delete operation.
|
protected <T> EntityConverter<T> |
getConverter(java.lang.Class<T> clz) |
java.util.ArrayList<android.content.ContentProviderOperation> |
getOperations()
Get the list of
ContentProviderOperations |
<T> ProviderOperationsCompartment |
put(android.net.Uri uri,
java.lang.Class<T> entityClass,
T... entities)
Add multiple put operations.
|
<T> ProviderOperationsCompartment |
put(android.net.Uri uri,
T entity)
Add an insert operation to the list of operations.
|
ProviderOperationsCompartment |
yield()
Allow the content provider to yield after the next operation (when supported by the provider).
|
ProviderOperationsCompartment |
yieldAfter(int operationCount)
Yield when the number of operations is reaches a multiple of the batch size set.
|
protected final Cupboard mCupboard
protected ProviderOperationsCompartment(Cupboard cupboard, java.util.ArrayList<android.content.ContentProviderOperation> operations)
public <T> ProviderOperationsCompartment put(android.net.Uri uri, T entity)
yield() was called, ContentProviderOperation.isYieldAllowed()
will be set.uri - the uri to insert toentity - the entity. If the entity has it's id field set, then this id will be appended to the uri as per ContentUris.appendId(android.net.Uri.Builder, long)ProviderOperationsCompartment for chainingpublic ProviderOperationsCompartment yield()
ProviderOperationsCompartment for chaining.SQLiteDatabase.yieldIfContendedSafely()public ProviderOperationsCompartment yieldAfter(int operationCount)
operationCount - the amount of operations allowed before yielding. Set to 1 to yield on every put or delete,
0 to control yielding using yield().ProviderOperationsCompartment for chaining. Perform other operations using the returned instance
to ensure yields are set after operationCount operations.public <T> ProviderOperationsCompartment put(android.net.Uri uri, java.lang.Class<T> entityClass, T... entities)
yield() was called, ContentProviderOperation.isYieldAllowed()
is set on the last operation.uri - the uri to callentityClass - the type of the entitiesentities - the entitiesProviderOperationsCompartment for chainingpublic <T> ProviderOperationsCompartment delete(android.net.Uri uri, T entity)
yield() was called, ContentProviderOperation.isYieldAllowed() will
be set.uri - the uri to call. The object id will be appended to this uri as per ContentUris.appendId(android.net.Uri.Builder, long). If no id is set no operation will be addedentity - the entity to delete, must have an idProviderOperationsCompartment for chainingpublic java.util.ArrayList<android.content.ContentProviderOperation> getOperations()
ContentProviderOperationsprotected <T> EntityConverter<T> getConverter(java.lang.Class<T> clz)