# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Methods | Inherited Methods

# ContentProviderOperation.Builder

`public static class ContentProviderOperation.Builder`
`extends Object` ``

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

Used to add parameters to a `ContentProviderOperation`. The `Builder` is first created by calling `ContentProviderOperation#newInsert(android.net.Uri)`, `ContentProviderOperation#newUpdate(android.net.Uri)`, `ContentProviderOperation#newDelete(android.net.Uri)` or `ContentProviderOperation#newAssertQuery(Uri)`. The withXXX methods can then be used to add parameters to the builder. See the specific methods to find for which `Builder` type each is allowed. Call `build()` to create the `ContentProviderOperation` once all the parameters have been supplied.

## Summary

### Public methods
`ContentProviderOperation` | `build()` Create a ContentProviderOperation from this `Builder`.
`ContentProviderOperation.Builder` | `withExceptionAllowed(boolean exceptionAllowed)` If set to true, this operation allows subsequent operations to continue even if this operation throws an exception.
`ContentProviderOperation.Builder` | `withExpectedCount(int count)` If set then if the number of rows affected by this operation does not match this count `OperationApplicationException` will be throw.
`ContentProviderOperation.Builder` | `withExtra(String key, Object value)` Configure the given extra to use for this operation.
`ContentProviderOperation.Builder` | `withExtraBackReference(String key, int fromIndex, String fromKey)` Configure the given extra to be dynamically overwritten using the result of a previous operation.
`ContentProviderOperation.Builder` | `withExtraBackReference(String key, int fromIndex)` Configure the given extra to be dynamically overwritten using the result of a previous operation.
`ContentProviderOperation.Builder` | `withExtras(Bundle extras)` Configure the extras to use for this operation.
`ContentProviderOperation.Builder` | `withSelection(String selection, String[] selectionArgs)` Configure the selection and selection arguments to use for this operation.
`ContentProviderOperation.Builder` | `withSelectionBackReference(int index, int fromIndex)` Configure the given selection argument to be dynamically overwritten using the result of a previous operation.
`ContentProviderOperation.Builder` | `withSelectionBackReference(int index, int fromIndex, String fromKey)` Configure the given selection argument to be dynamically overwritten using the result of a previous operation.
`ContentProviderOperation.Builder` | `withValue(String key, Object value)` Configure the given value to use for this operation.
`ContentProviderOperation.Builder` | `withValueBackReference(String key, int fromIndex, String fromKey)` Configure the given value to be dynamically overwritten using the result of a previous operation.
`ContentProviderOperation.Builder` | `withValueBackReference(String key, int fromIndex)` Configure the given value to be dynamically overwritten using the result of a previous operation.
`ContentProviderOperation.Builder` | `withValueBackReferences(ContentValues backReferences)` Configure the given values to be dynamically overwritten using the result of a previous operation.
`ContentProviderOperation.Builder` | `withValues(ContentValues values)` Configure the values to use for this operation.
`ContentProviderOperation.Builder` | `withYieldAllowed(boolean yieldAllowed)` If set to true then the operation allows yielding the database to other transactions if the database is contended.

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

## Public methods

### build

    public ContentProviderOperation build ()

Create a ContentProviderOperation from this `Builder`.

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

### withExceptionAllowed

    public ContentProviderOperation.Builder withExceptionAllowed (boolean exceptionAllowed)

If set to true, this operation allows subsequent operations to continue even if this operation throws an exception. When true, any encountered exception is returned via `ContentProviderResult#exception`.

Parameters
`exceptionAllowed` | `boolean`

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

### withExpectedCount

    public ContentProviderOperation.Builder withExpectedCount (int count)

If set then if the number of rows affected by this operation does not match this count `OperationApplicationException` will be throw. This can only be used with builders of type update, delete, or assert.

Parameters
`count` | `int`

Returns
`ContentProviderOperation.Builder` | this builder, to allow for chaining. This value cannot be `null`.

### withExtra

    public ContentProviderOperation.Builder withExtra (String key,
                    Object value)

Configure the given extra to use for this operation. This method will replace any previously defined extras for this key.

Parameters
`key` | `String`: the key indicating which extra to configure This value cannot be `null`.
`value` | `Object`: This value may be `null`.

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

### withExtraBackReference

    public ContentProviderOperation.Builder withExtraBackReference (String key,
                    int fromIndex,
                    String fromKey)

Configure the given extra to be dynamically overwritten using the result of a previous operation. This method will replace any previously defined extras for this key.

Parameters
`key` | `String`: the key indicating which extra to configure This value cannot be `null`.
`fromIndex` | `int`: the index indicating which historical `ContentProviderResult` should overwrite the extra
`fromKey` | `String`: the key of indicating which `ContentProviderResult#extras` value should overwrite the extra This value cannot be `null`.

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

### withExtraBackReference

    public ContentProviderOperation.Builder withExtraBackReference (String key,
                    int fromIndex)

Configure the given extra to be dynamically overwritten using the result of a previous operation. This method will replace any previously defined extras for this key.

Parameters
`key` | `String`: the key indicating which extra to configure This value cannot be `null`.
`fromIndex` | `int`: the index indicating which historical `ContentProviderResult` should overwrite the extra

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

### withExtras

    public ContentProviderOperation.Builder withExtras (Bundle extras)

Configure the extras to use for this operation. This method will replace any previously defined values for the contained keys, but it will not replace any back-reference requests.

Any value may be dynamically overwritten using the result of a previous operation by using methods such as `withExtraBackReference(java.lang.String, int)`.

Parameters
`extras` | `Bundle`: This value cannot be `null`.

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

### withSelection

    public ContentProviderOperation.Builder withSelection (String selection,
                    String[] selectionArgs)

Configure the selection and selection arguments to use for this operation. This method will replace any previously defined selection and selection arguments, but it will not replace any back-reference requests.

An occurrence of `?` in the selection will be replaced with the corresponding selection argument when the operation is executed.

Any selection argument may be dynamically overwritten using the result of a previous operation by using methods such as `withSelectionBackReference(int, int)`.

Parameters
`selection` | `String`: This value may be `null`.
`selectionArgs` | `String`: This value may be `null`.

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

### withSelectionBackReference

    public ContentProviderOperation.Builder withSelectionBackReference (int index,
                    int fromIndex)

Configure the given selection argument to be dynamically overwritten using the result of a previous operation. This method will replace any previously defined selection argument at this index.

Parameters
`index` | `int`: the index indicating which selection argument to configure
`fromIndex` | `int`: the index indicating which historical `ContentProviderResult` should overwrite the selection argument

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

### withSelectionBackReference

    public ContentProviderOperation.Builder withSelectionBackReference (int index,
                    int fromIndex,
                    String fromKey)

Configure the given selection argument to be dynamically overwritten using the result of a previous operation. This method will replace any previously defined selection argument at this index.

Parameters
`index` | `int`: the index indicating which selection argument to configure
`fromIndex` | `int`: the index indicating which historical `ContentProviderResult` should overwrite the selection argument
`fromKey` | `String`: the key of indicating which `ContentProviderResult#extras` value should overwrite the selection argument This value cannot be `null`.

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

### withValue

    public ContentProviderOperation.Builder withValue (String key,
                    Object value)

Configure the given value to use for this operation. This method will replace any previously defined value for this key.

Parameters
`key` | `String`: the key indicating which value to configure This value cannot be `null`.
`value` | `Object`: This value may be `null`.

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

### withValueBackReference

    public ContentProviderOperation.Builder withValueBackReference (String key,
                    int fromIndex,
                    String fromKey)

Configure the given value to be dynamically overwritten using the result of a previous operation. This method will replace any previously defined value for this key.

Parameters
`key` | `String`: the key indicating which value to configure This value cannot be `null`.
`fromIndex` | `int`: the index indicating which historical `ContentProviderResult` should overwrite the value
`fromKey` | `String`: the key of indicating which `ContentProviderResult#extras` value should overwrite the value This value cannot be `null`.

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

### withValueBackReference

    public ContentProviderOperation.Builder withValueBackReference (String key,
                    int fromIndex)

Configure the given value to be dynamically overwritten using the result of a previous operation. This method will replace any previously defined value for this key.

Parameters
`key` | `String`: the key indicating which value to configure This value cannot be `null`.
`fromIndex` | `int`: the index indicating which historical `ContentProviderResult` should overwrite the value

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

### withValueBackReferences

    public ContentProviderOperation.Builder withValueBackReferences (ContentValues backReferences)

Configure the given values to be dynamically overwritten using the result of a previous operation. This method will replace any previously defined values for these keys.

Parameters
`backReferences` | `ContentValues`: set of values where the key indicates which value to configure and the value the index indicating which historical `ContentProviderResult` should overwrite the value This value cannot be `null`.

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

### withValues

    public ContentProviderOperation.Builder withValues (ContentValues values)

Configure the values to use for this operation. This method will replace any previously defined values for the contained keys, but it will not replace any back-reference requests.

Any value may be dynamically overwritten using the result of a previous operation by using methods such as `withValueBackReference(java.lang.String, int)`.

Parameters
`values` | `ContentValues`: This value cannot be `null`.

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

### withYieldAllowed

    public ContentProviderOperation.Builder withYieldAllowed (boolean yieldAllowed)

If set to true then the operation allows yielding the database to other transactions if the database is contended.

Parameters
`yieldAllowed` | `boolean`

Returns
`ContentProviderOperation.Builder` | this builder, to allow for chaining. This value cannot be `null`.

See also:

- `SQLiteDatabase.yieldIfContendedSafely()`

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