Added in API level 5

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 ContentProviderOperation.

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

Gets the Uri for the target of the operation.

open Boolean

Returns true if the operation represents an assert query.

open Boolean

Returns true if the operation represents a android.

open Boolean

Returns true if the operation represents a android.

open Boolean

Returns true if this operation allows subsequent operations to continue even if this operation throws an exception.

open Boolean

Returns true if the operation represents a android.

open Boolean

Returns true if the operation represents an assert query.

open Boolean

Returns true if the operation represents a android.

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

Create a Builder suitable for building a ContentProviderOperation to assert a set of values as provided through Builder#withValues(ContentValues).

open static ContentProviderOperation.Builder
newCall(uri: Uri, method: String?, arg: String?)

Create a Builder suitable for building an operation that will invoke android.

open static ContentProviderOperation.Builder
newDelete(uri: Uri)

Create a Builder suitable for building an operation that will invoke android.

open static ContentProviderOperation.Builder
newInsert(uri: Uri)

Create a Builder suitable for building an operation that will invoke android.

open static ContentProviderOperation.Builder
newUpdate(uri: Uri)

Create a Builder suitable for building an operation that will invoke android.

open Bundle?

Return the extras for this operation after resolving any requested back-references using the given results.

open Array<String!>?

Return the selection arguments for this operation after resolving any requested back-references using the given results.

open ContentValues?

Return the values for this operation after resolving any requested back-references using the given results.

open String

open Unit
writeToParcel(dest: Parcel, flags: Int)

Properties
static Parcelable.Creator<ContentProviderOperation!>

Public methods

apply

Added in API level 5
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 android.content.ContentProviderOperation.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

Added in API level 5
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

Added in API level 5
open fun getUri(): Uri

Gets the Uri for the target of the operation.

Return
Uri This value cannot be null.

isAssertQuery

Added in API level 23
open fun isAssertQuery(): Boolean

Returns true if the operation represents an assert query.

See Also

isCall

Added in API level 30
open fun isCall(): Boolean

Returns true if the operation represents a android.content.ContentProvider#call operation.

See Also

isDelete

Added in API level 23
open fun isDelete(): Boolean

Returns true if the operation represents a android.content.ContentProvider#delete operation.

See Also

isExceptionAllowed

Added in API level 30
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

Added in API level 23
open fun isInsert(): Boolean

Returns true if the operation represents a android.content.ContentProvider#insert operation.

See Also

isReadOperation

Added in API level 5
open fun isReadOperation(): Boolean

Returns true if the operation represents an assert query.

See Also

isUpdate

Added in API level 23
open fun isUpdate(): Boolean

Returns true if the operation represents a android.content.ContentProvider#update operation.

See Also

isWriteOperation

Added in API level 5
open fun isWriteOperation(): Boolean

Returns true if the operation represents an insertion, deletion, or update.

isYieldAllowed

Added in API level 5
open fun isYieldAllowed(): Boolean

Returns true if the operation allows yielding the database to other transactions if the database is contended.

newAssertQuery

Added in API level 5
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

Added in API level 30
open static fun newCall(
    uri: Uri,
    method: String?,
    arg: String?
): ContentProviderOperation.Builder

Create a Builder suitable for building an operation that will invoke android.content.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

Added in API level 5
open static fun newDelete(uri: Uri): ContentProviderOperation.Builder

Create a Builder suitable for building an operation that will invoke android.content.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

Added in API level 5
open static fun newInsert(uri: Uri): ContentProviderOperation.Builder

Create a Builder suitable for building an operation that will invoke android.content.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

Added in API level 5
open static fun newUpdate(uri: Uri): ContentProviderOperation.Builder

Create a Builder suitable for building an operation that will invoke android.content.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

Added in API level 30
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

Added in API level 5
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

Added in API level 5
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

Added in API level 5
open fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 5
open fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit
Parameters
dest Parcel: The Parcel in which the object should be written. This value cannot be null.
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

Properties

CREATOR

Added in API level 5
static val CREATOR: Parcelable.Creator<ContentProviderOperation!>