# ContentProviderOperation

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/content/ContentProviderOperation#nestedclasses)\|[Inherited Constants](https://developer.android.com/reference/android/content/ContentProviderOperation#inhconstants)\|[Fields](https://developer.android.com/reference/android/content/ContentProviderOperation#lfields)\|[Methods](https://developer.android.com/reference/android/content/ContentProviderOperation#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/content/ContentProviderOperation#inhmethods)  

# ContentProviderOperation

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/content/ContentProviderOperation "View this page in Kotlin")\|Java

`
public


class
ContentProviderOperation
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


implements

`[Parcelable](https://developer.android.com/reference/android/os/Parcelable)`


`

|---|------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.content.ContentProviderOperation |

<br />

*** ** * ** ***

Represents a single operation to be performed as part of a batch of operations.  
**See also:**

- [ContentProvider.applyBatch(ArrayList)](https://developer.android.com/reference/android/content/ContentProvider#applyBatch(java.util.ArrayList<android.content.ContentProviderOperation>))

## Summary

|                                                                                                                               ### Nested classes                                                                                                                                ||
|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [ContentProviderOperation.Builder](https://developer.android.com/reference/android/content/ContentProviderOperation.Builder) Used to add parameters to a[ContentProviderOperation](https://developer.android.com/reference/android/content/ContentProviderOperation). |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From interface[android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable) |-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int` | [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR) Descriptor bit used with[describeContents()](https://developer.android.com/reference/android/os/Parcelable#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor.                                                                                                                                            | | `int` | [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE) Flag for use with[writeToParcel(Parcel, int)](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)): 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](https://developer.android.com/reference/android/os/Parcelable.Creator)`<`[ContentProviderOperation](https://developer.android.com/reference/android/content/ContentProviderOperation)`>` | [CREATOR](https://developer.android.com/reference/android/content/ContentProviderOperation#CREATOR) <br /> |

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

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

## Fields

### CREATOR

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final Creator<ContentProviderOperation> CREATOR
```

<br />

<br />

## Public methods

### apply

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
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)](https://developer.android.com/reference/android/content/ContentProviderOperation.Builder#withValueBackReferences(android.content.ContentValues))and[Builder.withSelectionBackReference](https://developer.android.com/reference/android/content/ContentProviderOperation.Builder#withSelectionBackReference(int,%20int)).

<br />

|                                                                                                                        Parameters                                                                                                                        ||
|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `provider`    | `ContentProvider`: the[ContentProvider](https://developer.android.com/reference/android/content/ContentProvider)on which this batch is applied This value cannot be`null`. <br />                                                         |
| `backRefs`    | `ContentProviderResult`: a[ContentProviderResult](https://developer.android.com/reference/android/content/ContentProviderResult)array that will be consulted to resolve any requested back references. This value cannot be`null`. <br /> |
| `numBackRefs` | `int`: the number of valid results on the backRefs array. <br />                                                                                                                                                                          |

|                                                                                                                                                                                                         Returns                                                                                                                                                                                                          ||
|--------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ContentProviderResult](https://developer.android.com/reference/android/content/ContentProviderResult) | a[ContentProviderResult](https://developer.android.com/reference/android/content/ContentProviderResult)that contains either the[Uri](https://developer.android.com/reference/android/net/Uri)of the inserted row if this was an insert otherwise the number of rows affected. This value cannot be`null`. <br /> |

|                                                                                                           Throws                                                                                                            ||
|------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| [OperationApplicationException](https://developer.android.com/reference/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](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
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)](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)), the return value of this method must include the[CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR)bit.

<br />

|                                                                                                                         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](https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR) <br /> |

### getUri

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public Uri getUri ()
```

Gets the Uri for the target of the operation.

<br />

|                                              Returns                                               ||
|----------------------------------------------------------------|------------------------------------|
| [Uri](https://developer.android.com/reference/android/net/Uri) | This value cannot be`null`. <br /> |

### isAssertQuery

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isAssertQuery ()
```

Returns true if the operation represents an assert query.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

**See also:**

- [newAssertQuery(Uri)](https://developer.android.com/reference/android/content/ContentProviderOperation#newAssertQuery(android.net.Uri))  

### isCall

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isCall ()
```

Returns true if the operation represents a[ContentProvider.call](https://developer.android.com/reference/android/content/ContentProvider#call(java.lang.String,%20java.lang.String,%20android.os.Bundle))operation.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

**See also:**

- [newCall(Uri, String, String)](https://developer.android.com/reference/android/content/ContentProviderOperation#newCall(android.net.Uri,%20java.lang.String,%20java.lang.String))  

### isDelete

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isDelete ()
```

Returns true if the operation represents a[ContentProvider.delete](https://developer.android.com/reference/android/content/ContentProvider#delete(android.net.Uri,%20android.os.Bundle))operation.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

**See also:**

- [newDelete(Uri)](https://developer.android.com/reference/android/content/ContentProviderOperation#newDelete(android.net.Uri))  

### isExceptionAllowed

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
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](https://developer.android.com/reference/android/content/ContentProviderResult#exception).

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### isInsert

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isInsert ()
```

Returns true if the operation represents a[ContentProvider.insert](https://developer.android.com/reference/android/content/ContentProvider#insert(android.net.Uri,%20android.content.ContentValues))operation.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

**See also:**

- [newInsert(Uri)](https://developer.android.com/reference/android/content/ContentProviderOperation#newInsert(android.net.Uri))  

### isReadOperation

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isReadOperation ()
```

Returns true if the operation represents an assert query.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

**See also:**

- [isAssertQuery()](https://developer.android.com/reference/android/content/ContentProviderOperation#isAssertQuery())  

### isUpdate

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isUpdate ()
```

Returns true if the operation represents a[ContentProvider.update](https://developer.android.com/reference/android/content/ContentProvider#update(android.net.Uri,%20android.content.ContentValues,%20android.os.Bundle))operation.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

**See also:**

- [newUpdate(Uri)](https://developer.android.com/reference/android/content/ContentProviderOperation#newUpdate(android.net.Uri))  

### isWriteOperation

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isWriteOperation ()
```

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

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

**See also:**

- [isInsert()](https://developer.android.com/reference/android/content/ContentProviderOperation#isInsert())
- [isDelete()](https://developer.android.com/reference/android/content/ContentProviderOperation#isDelete())
- [isUpdate()](https://developer.android.com/reference/android/content/ContentProviderOperation#isUpdate())  

### isYieldAllowed

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isYieldAllowed ()
```

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

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

**See also:**

- [SQLiteDatabase.yieldIfContendedSafely()](https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase#yieldIfContendedSafely())  

### newAssertQuery

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static ContentProviderOperation.Builder newAssertQuery (Uri uri)
```

Create a[Builder](https://developer.android.com/reference/android/content/ContentProviderOperation.Builder)suitable for building a[ContentProviderOperation](https://developer.android.com/reference/android/content/ContentProviderOperation)to assert a set of values as provided through[Builder.withValues(ContentValues)](https://developer.android.com/reference/android/content/ContentProviderOperation.Builder#withValues(android.content.ContentValues)).

<br />

|                    Parameters                    ||
|-------|-------------------------------------------|
| `uri` | `Uri`: This value cannot be`null`. <br /> |

|                                                                             Returns                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [ContentProviderOperation.Builder](https://developer.android.com/reference/android/content/ContentProviderOperation.Builder) | This value cannot be`null`. <br /> |

### newCall

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

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

Create a[Builder](https://developer.android.com/reference/android/content/ContentProviderOperation.Builder)suitable for building an operation that will invoke[ContentProvider.call](https://developer.android.com/reference/android/content/ContentProvider#call(java.lang.String,%20java.lang.String,%20android.os.Bundle)).

<br />

|                                                                        Parameters                                                                         ||
|----------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri`    | `Uri`: The[Uri](https://developer.android.com/reference/android/net/Uri)that is the target of the operation. This value cannot be`null`. <br /> |
| `method` | `String`: This value may be`null`. <br />                                                                                                       |
| `arg`    | `String`: This value may be`null`. <br />                                                                                                       |

|                                                                             Returns                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [ContentProviderOperation.Builder](https://developer.android.com/reference/android/content/ContentProviderOperation.Builder) | This value cannot be`null`. <br /> |

### newDelete

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static ContentProviderOperation.Builder newDelete (Uri uri)
```

Create a[Builder](https://developer.android.com/reference/android/content/ContentProviderOperation.Builder)suitable for building an operation that will invoke[ContentProvider.delete](https://developer.android.com/reference/android/content/ContentProvider#delete(android.net.Uri,%20android.os.Bundle)).

<br />

|                                                                       Parameters                                                                       ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri` | `Uri`: The[Uri](https://developer.android.com/reference/android/net/Uri)that is the target of the operation. This value cannot be`null`. <br /> |

|                                                                             Returns                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [ContentProviderOperation.Builder](https://developer.android.com/reference/android/content/ContentProviderOperation.Builder) | This value cannot be`null`. <br /> |

### newInsert

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static ContentProviderOperation.Builder newInsert (Uri uri)
```

Create a[Builder](https://developer.android.com/reference/android/content/ContentProviderOperation.Builder)suitable for building an operation that will invoke[ContentProvider.insert](https://developer.android.com/reference/android/content/ContentProvider#insert(android.net.Uri,%20android.content.ContentValues)).

<br />

|                                                                       Parameters                                                                       ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri` | `Uri`: The[Uri](https://developer.android.com/reference/android/net/Uri)that is the target of the operation. This value cannot be`null`. <br /> |

|                                                                             Returns                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [ContentProviderOperation.Builder](https://developer.android.com/reference/android/content/ContentProviderOperation.Builder) | This value cannot be`null`. <br /> |

### newUpdate

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static ContentProviderOperation.Builder newUpdate (Uri uri)
```

Create a[Builder](https://developer.android.com/reference/android/content/ContentProviderOperation.Builder)suitable for building an operation that will invoke[ContentProvider.update](https://developer.android.com/reference/android/content/ContentProvider#update(android.net.Uri,%20android.content.ContentValues,%20android.os.Bundle)).

<br />

|                                                                       Parameters                                                                       ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `uri` | `Uri`: The[Uri](https://developer.android.com/reference/android/net/Uri)that is the target of the operation. This value cannot be`null`. <br /> |

|                                                                             Returns                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [ContentProviderOperation.Builder](https://developer.android.com/reference/android/content/ContentProviderOperation.Builder) | This value cannot be`null`. <br /> |

### resolveExtrasBackReferences

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

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

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

<br />

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

|                                               Returns                                                ||
|---------------------------------------------------------------------|---------------------------------|
| [Bundle](https://developer.android.com/reference/android/os/Bundle) | This value may be`null`. <br /> |

### resolveSelectionArgsBackReferences

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

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

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

<br />

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

|                                                Returns                                                ||
|----------------------------------------------------------------------|---------------------------------|
| [String[]](https://developer.android.com/reference/java/lang/String) | This value may be`null`. <br /> |

### resolveValueBackReferences

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

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

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

<br />

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

|                                                         Returns                                                         ||
|----------------------------------------------------------------------------------------|---------------------------------|
| [ContentValues](https://developer.android.com/reference/android/content/ContentValues) | This value may be`null`. <br /> |

### toString

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public String toString ()
```

Returns a string representation of the object.

<br />

|                                                      Returns                                                      ||
|--------------------------------------------------------------------|-----------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | a string representation of the object. <br /> |

### writeToParcel

Added in[API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

|                                                                                                                                                                                                                               Parameters                                                                                                                                                                                                                                ||
|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dest`  | `Parcel`: The Parcel in which the object should be written. This value cannot be`null`. <br />                                                                                                                                                                                                                                                                                                                                                                 |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or[Parcelable.PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE). Value is either`0`or a combination of[Parcelable.PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE), and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES <br /> |