# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Nested Classes | Inherited Constants | Fields | Methods | Inherited Methods

# ContentProviderOperation

`public class ContentProviderOperation`
`extends Object` `implements Parcelable`

java.lang.Object
↳ | android.content.ContentProviderOperation

Represents a single operation to be performed as part of a batch of operations.

See also:

- `ContentProvider.applyBatch(ArrayList)`

## Summary

### Nested classes
`class` | `ContentProviderOperation.Builder` Used to add parameters to a `ContentProviderOperation`.

### Inherited constants
From interface `android.os.Parcelable`
`int` | `CONTENTS_FILE_DESCRIPTOR` Descriptor bit used with `describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor.
`int` | `PARCELABLE_WRITE_RETURN_VALUE` Flag for use with `writeToParcel(Parcel, int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`".

### Fields
`public static final Creator<ContentProviderOperation>` | `CREATOR`

### Public methods
`ContentProviderResult` | `apply(ContentProvider provider, ContentProviderResult[] backRefs, int numBackRefs)` Applies this operation using the given provider.
`int` | `describeContents()` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
`Uri` | `getUri()` Gets the Uri for the target of the operation.
`boolean` | `isAssertQuery()` Returns true if the operation represents an assert query.
`boolean` | `isCall()` Returns true if the operation represents a `ContentProvider#call` operation.
`boolean` | `isDelete()` Returns true if the operation represents a `ContentProvider#delete` operation.
`boolean` | `isExceptionAllowed()` Returns true if this operation allows subsequent operations to continue even if this operation throws an exception.
`boolean` | `isInsert()` Returns true if the operation represents a `ContentProvider#insert` operation.
`boolean` | `isReadOperation()` Returns true if the operation represents an assert query.
`boolean` | `isUpdate()` Returns true if the operation represents a `ContentProvider#update` operation.
`boolean` | `isWriteOperation()` Returns true if the operation represents an insertion, deletion, or update.
`boolean` | `isYieldAllowed()` Returns true if the operation allows yielding the database to other transactions if the database is contended.
`static ContentProviderOperation.Builder` | `newAssertQuery(Uri uri)` Create a `Builder` suitable for building a `ContentProviderOperation` to assert a set of values as provided through `Builder#withValues(ContentValues)`.
`static ContentProviderOperation.Builder` | `newCall(Uri uri, String method, String arg)` Create a `Builder` suitable for building an operation that will invoke `ContentProvider#call`.
`static ContentProviderOperation.Builder` | `newDelete(Uri uri)` Create a `Builder` suitable for building an operation that will invoke `ContentProvider#delete`.
`static ContentProviderOperation.Builder` | `newInsert(Uri uri)` Create a `Builder` suitable for building an operation that will invoke `ContentProvider#insert`.
`static ContentProviderOperation.Builder` | `newUpdate(Uri uri)` Create a `Builder` suitable for building an operation that will invoke `ContentProvider#update`.
`Bundle` | `resolveExtrasBackReferences(ContentProviderResult[] backRefs, int numBackRefs)` Return the extras for this operation after resolving any requested back-references using the given results.
`String[]` | `resolveSelectionArgsBackReferences(ContentProviderResult[] backRefs, int numBackRefs)` Return the selection arguments for this operation after resolving any requested back-references using the given results.
`ContentValues` | `resolveValueBackReferences(ContentProviderResult[] backRefs, int numBackRefs)` Return the values for this operation after resolving any requested back-references using the given results.
`String` | `toString()` Returns a string representation of the object.
`void` | `writeToParcel(Parcel dest, int flags)` Flatten this object in to a Parcel.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.
From interface `android.os.Parcelable`
`abstract int` | `describeContents()` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
`abstract void` | `writeToParcel(Parcel dest, int flags)` Flatten this object in to a Parcel.

## Fields

### CREATOR

    public static final Creator<ContentProviderOperation> CREATOR

## Public methods

### apply

    public ContentProviderResult apply (ContentProvider provider,
                    ContentProviderResult[] backRefs,
                    int numBackRefs)

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

Returns
`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`.

Throws
`OperationApplicationException` | thrown if either the insert fails or if the number of rows affected didn't match the expected count

### describeContents

    public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of `writeToParcel(android.os.Parcel, int)`, the return value of this method must include the `CONTENTS_FILE_DESCRIPTOR` bit.

Returns
`int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or `CONTENTS_FILE_DESCRIPTOR`

### getUri

    public Uri getUri ()

Gets the Uri for the target of the operation.

Returns
`Uri` | This value cannot be `null`.

### isAssertQuery

    public boolean isAssertQuery ()

Returns true if the operation represents an assert query.

Returns
`boolean` |

See also:

- `newAssertQuery(Uri)`

### isCall

    public boolean isCall ()

Returns true if the operation represents a `ContentProvider#call` operation.

Returns
`boolean` |

See also:

- `newCall(Uri, String, String)`

### isDelete

    public boolean isDelete ()

Returns true if the operation represents a `ContentProvider#delete` operation.

Returns
`boolean` |

See also:

- `newDelete(Uri)`

### isExceptionAllowed

    public boolean isExceptionAllowed ()

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

Returns
`boolean` |

### isInsert

    public boolean isInsert ()

Returns true if the operation represents a `ContentProvider#insert` operation.

Returns
`boolean` |

See also:

- `newInsert(Uri)`

### isReadOperation

    public boolean isReadOperation ()

Returns true if the operation represents an assert query.

Returns
`boolean` |

See also:

- `isAssertQuery()`

### isUpdate

    public boolean isUpdate ()

Returns true if the operation represents a `ContentProvider#update` operation.

Returns
`boolean` |

See also:

- `newUpdate(Uri)`

### isWriteOperation

    public boolean isWriteOperation ()

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

Returns
`boolean` |

See also:

- `isInsert()`
- `isDelete()`
- `isUpdate()`

### isYieldAllowed

    public boolean isYieldAllowed ()

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

Returns
`boolean` |

See also:

- `SQLiteDatabase.yieldIfContendedSafely()`

### newAssertQuery

    public static ContentProviderOperation.Builder newAssertQuery (Uri uri)

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

Returns
`ContentProviderOperation.Builder` | This value cannot be `null`.

### newCall

    public static ContentProviderOperation.Builder newCall (Uri uri,
                    String method,
                    String arg)

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

Returns
`ContentProviderOperation.Builder` | This value cannot be `null`.

### newDelete

    public static ContentProviderOperation.Builder newDelete (Uri uri)

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

Returns
`ContentProviderOperation.Builder` | This value cannot be `null`.

### newInsert

    public static ContentProviderOperation.Builder newInsert (Uri uri)

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

Returns
`ContentProviderOperation.Builder` | This value cannot be `null`.

### newUpdate

    public static ContentProviderOperation.Builder newUpdate (Uri uri)

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

Returns
`ContentProviderOperation.Builder` | This value cannot be `null`.

### resolveExtrasBackReferences

    public Bundle resolveExtrasBackReferences (ContentProviderResult[] backRefs,
                    int numBackRefs)

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

Parameters
`backRefs` | `ContentProviderResult`: the results to use when resolving any back-references This value cannot be `null`.
`numBackRefs` | `int`: the number of results which are valid

Returns
`Bundle` | This value may be `null`.

### resolveSelectionArgsBackReferences

    public String[] resolveSelectionArgsBackReferences (ContentProviderResult[] backRefs,
                    int numBackRefs)

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

Parameters
`backRefs` | `ContentProviderResult`: the results to use when resolving any back-references This value cannot be `null`.
`numBackRefs` | `int`: the number of results which are valid

Returns
`String[]` | This value may be `null`.

### resolveValueBackReferences

    public ContentValues resolveValueBackReferences (ContentProviderResult[] backRefs,
                    int numBackRefs)

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

Parameters
`backRefs` | `ContentProviderResult`: the results to use when resolving any back-references This value cannot be `null`.
`numBackRefs` | `int`: the number of results which are valid

Returns
`ContentValues` | This value may be `null`.

### toString

    public String toString ()

Returns a string representation of the object. In general, the `toString` method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The `toString` method for class `Object` returns a string consisting of the name of the class of which the object is an instance, the at-sign character ``@`', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

>      getClass().getName() + '@' + Integer.toHexString(hashCode())

Returns
`String` | a string representation of the object.

### writeToParcel

    public void writeToParcel (Parcel dest,
                    int flags)

Flatten this object in to a Parcel.

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.PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of `Parcelable.PARCELABLE_WRITE_RETURN_VALUE`, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*