ContentProviderOperation
open class ContentProviderOperation : Parcelable
| kotlin.Any | |
| ↳ | android.content.ContentProviderOperation |
Represents a single operation to be performed as part of a batch of operations.
Summary
Nested classes |
|
|---|---|
| open |
Used to add parameters to a |
Inherited constants |
|
|---|---|
Public methods |
|
|---|---|
| open ContentProviderResult |
apply(provider: ContentProvider, backRefs: Array<ContentProviderResult!>, numBackRefs: Int)Applies this operation using the given provider. |
| open Int | |
| open Uri |
getUri()Gets the Uri for the target of the operation. |
| open Boolean |
Returns true if the operation represents an assert query. |
| open Boolean |
isCall()Returns true if the operation represents a |
| open Boolean |
isDelete()Returns true if the operation represents a |
| open Boolean |
Returns true if this operation allows subsequent operations to continue even if this operation throws an exception. |
| open Boolean |
isInsert()Returns true if the operation represents a |
| open Boolean |
Returns true if the operation represents an assert query. |
| open Boolean |
isUpdate()Returns true if the operation represents a |
| open Boolean |
Returns true if the operation represents an insertion, deletion, or update. |
| open Boolean |
Returns true if the operation allows yielding the database to other transactions if the database is contended. |
| open static ContentProviderOperation.Builder |
newAssertQuery(uri: Uri)Create a |
| open static ContentProviderOperation.Builder |
Create a |
| open static ContentProviderOperation.Builder |
Create a |
| open static ContentProviderOperation.Builder |
Create a |
| open static ContentProviderOperation.Builder |
Create a |
| open Bundle? |
resolveExtrasBackReferences(backRefs: Array<ContentProviderResult!>, numBackRefs: Int)Return the extras for this operation after resolving any requested back-references using the given results. |
| open Array<String!>? |
resolveSelectionArgsBackReferences(backRefs: Array<ContentProviderResult!>, numBackRefs: Int)Return the selection arguments for this operation after resolving any requested back-references using the given results. |
| open ContentValues? |
resolveValueBackReferences(backRefs: Array<ContentProviderResult!>, numBackRefs: Int)Return the values for this operation after resolving any requested back-references using the given results. |
| open String |
toString() |
| open Unit |
writeToParcel(dest: Parcel!, flags: Int) |
Properties |
|
|---|---|
| static Parcelable.Creator<ContentProviderOperation!> | |
Public methods
apply
open fun apply(
provider: ContentProvider,
backRefs: Array<ContentProviderResult!>,
numBackRefs: Int
): ContentProviderResult
Applies this operation using the given provider. The backRefs array is used to resolve any back references that were requested using Builder#withValueBackReferences(ContentValues) and Builder#withSelectionBackReference.
| Parameters | |
|---|---|
provider |
ContentProvider: the ContentProvider on which this batch is applied This value cannot be null. |
backRefs |
Array<ContentProviderResult!>: a ContentProviderResult array that will be consulted to resolve any requested back references. This value cannot be null. |
numBackRefs |
Int: the number of valid results on the backRefs array. |
| Return | |
|---|---|
ContentProviderResult |
a ContentProviderResult that contains either the Uri of the inserted row if this was an insert otherwise the number of rows affected. This value cannot be null. |
| Exceptions | |
|---|---|
android.content.OperationApplicationException |
thrown if either the insert fails or if the number of rows affected didn't match the expected count |
describeContents
open fun describeContents(): Int
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
getUri
open fun getUri(): Uri
Gets the Uri for the target of the operation.
| Return | |
|---|---|
Uri |
This value cannot be null. |
isAssertQuery
open fun isAssertQuery(): Boolean
Returns true if the operation represents an assert query.
See Also
isCall
open fun isCall(): Boolean
Returns true if the operation represents a ContentProvider#call operation.
See Also
isDelete
open fun isDelete(): Boolean
Returns true if the operation represents a ContentProvider#delete operation.
See Also
isExceptionAllowed
open fun isExceptionAllowed(): Boolean
Returns true if this operation allows subsequent operations to continue even if this operation throws an exception. When true, any encountered exception is returned via ContentProviderResult#exception.
isInsert
open fun isInsert(): Boolean
Returns true if the operation represents a ContentProvider#insert operation.
See Also
isReadOperation
open fun isReadOperation(): Boolean
Returns true if the operation represents an assert query.
See Also
isUpdate
open fun isUpdate(): Boolean
Returns true if the operation represents a ContentProvider#update operation.
See Also
isWriteOperation
open fun isWriteOperation(): Boolean
Returns true if the operation represents an insertion, deletion, or update.
isYieldAllowed
open fun isYieldAllowed(): Boolean
Returns true if the operation allows yielding the database to other transactions if the database is contended.
newAssertQuery
open static fun newAssertQuery(uri: Uri): ContentProviderOperation.Builder
Create a Builder suitable for building a ContentProviderOperation to assert a set of values as provided through Builder#withValues(ContentValues).
| Parameters | |
|---|---|
uri |
Uri: This value cannot be null. |
| Return | |
|---|---|
ContentProviderOperation.Builder |
This value cannot be null. |
newCall
open static fun newCall(
uri: Uri,
method: String?,
arg: String?
): ContentProviderOperation.Builder
Create a Builder suitable for building an operation that will invoke ContentProvider#call.
| Parameters | |
|---|---|
uri |
Uri: The Uri that is the target of the operation. This value cannot be null. |
method |
String?: This value may be null. |
arg |
String?: This value may be null. |
| Return | |
|---|---|
ContentProviderOperation.Builder |
This value cannot be null. |
newDelete
open static fun newDelete(uri: Uri): ContentProviderOperation.Builder
Create a Builder suitable for building an operation that will invoke ContentProvider#delete.
| Parameters | |
|---|---|
uri |
Uri: The Uri that is the target of the operation. This value cannot be null. |
| Return | |
|---|---|
ContentProviderOperation.Builder |
This value cannot be null. |
newInsert
open static fun newInsert(uri: Uri): ContentProviderOperation.Builder
Create a Builder suitable for building an operation that will invoke ContentProvider#insert.
| Parameters | |
|---|---|
uri |
Uri: The Uri that is the target of the operation. This value cannot be null. |
| Return | |
|---|---|
ContentProviderOperation.Builder |
This value cannot be null. |
newUpdate
open static fun newUpdate(uri: Uri): ContentProviderOperation.Builder
Create a Builder suitable for building an operation that will invoke ContentProvider#update.
| Parameters | |
|---|---|
uri |
Uri: The Uri that is the target of the operation. This value cannot be null. |
| Return | |
|---|---|
ContentProviderOperation.Builder |
This value cannot be null. |
resolveExtrasBackReferences
open fun resolveExtrasBackReferences(
backRefs: Array<ContentProviderResult!>,
numBackRefs: Int
): Bundle?
Return the extras for this operation after resolving any requested back-references using the given results.
| Parameters | |
|---|---|
backRefs |
Array<ContentProviderResult!>: the results to use when resolving any back-references This value cannot be null. |
numBackRefs |
Int: the number of results which are valid |
| Return | |
|---|---|
Bundle? |
This value may be null. |
resolveSelectionArgsBackReferences
open fun resolveSelectionArgsBackReferences(
backRefs: Array<ContentProviderResult!>,
numBackRefs: Int
): Array<String!>?
Return the selection arguments for this operation after resolving any requested back-references using the given results.
| Parameters | |
|---|---|
backRefs |
Array<ContentProviderResult!>: the results to use when resolving any back-references This value cannot be null. |
numBackRefs |
Int: the number of results which are valid |
| Return | |
|---|---|
Array<String!>? |
This value may be null. |
resolveValueBackReferences
open fun resolveValueBackReferences(
backRefs: Array<ContentProviderResult!>,
numBackRefs: Int
): ContentValues?
Return the values for this operation after resolving any requested back-references using the given results.
| Parameters | |
|---|---|
backRefs |
Array<ContentProviderResult!>: the results to use when resolving any back-references This value cannot be null. |
numBackRefs |
Int: the number of results which are valid |
| Return | |
|---|---|
ContentValues? |
This value may be null. |
toString
open fun toString(): String
| Return | |
|---|---|
String |
a string representation of the object. |
writeToParcel
open fun writeToParcel(
dest: Parcel!,
flags: Int
): Unit
| Parameters | |
|---|---|
dest |
Parcel!: The Parcel in which the object should be written. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |