# DataRemovalRequest.Builder

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

# Builder

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/view/contentcapture/DataRemovalRequest.Builder "View this page in Java")  

```
class Builder
```

|---|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                   ||
| ↳ | [android.view.contentcapture.DataRemovalRequest.Builder](https://developer.android.com/reference/kotlin/android/view/contentcapture/DataRemovalRequest.Builder#) |

Builder for [DataRemovalRequest](https://developer.android.com/reference/kotlin/android/view/contentcapture/DataRemovalRequest) objects.

## Summary

|                                                           Public constructors                                                            ||
|---------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/view/contentcapture/DataRemovalRequest.Builder#Builder())`()` <br /> |

|                                                                                                                                                                                                                                                                                                                       Public methods                                                                                                                                                                                                                                                                                                                       ||
|--------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DataRemovalRequest.Builder](https://developer.android.com/reference/kotlin/android/view/contentcapture/DataRemovalRequest.Builder#) | [addLocusId](https://developer.android.com/reference/kotlin/android/view/contentcapture/DataRemovalRequest.Builder#addLocusId(android.content.LocusId,%20kotlin.Int))`(`locusId:` `[LocusId](https://developer.android.com/reference/kotlin/android/content/LocusId.html#)`, `flags:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Request service to remove data associated with a given [LocusId](https://developer.android.com/reference/kotlin/android/content/LocusId.html#). |
| [DataRemovalRequest](https://developer.android.com/reference/kotlin/android/view/contentcapture/DataRemovalRequest)                  | [build](https://developer.android.com/reference/kotlin/android/view/contentcapture/DataRemovalRequest.Builder#build())`()` Builds the [DataRemovalRequest](https://developer.android.com/reference/kotlin/android/view/contentcapture/DataRemovalRequest).                                                                                                                                                                                                                                                           |
| [DataRemovalRequest.Builder](https://developer.android.com/reference/kotlin/android/view/contentcapture/DataRemovalRequest.Builder#) | [forEverything](https://developer.android.com/reference/kotlin/android/view/contentcapture/DataRemovalRequest.Builder#forEverything())`()` Requests servive to remove all content capture data associated with the app's package.                                                                                                                                                                                                                                                                                    |

## Public constructors

### Builder

```
Builder()
```

## Public methods

### addLocusId

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

```
fun addLocusId(
    locusId: LocusId, 
    flags: Int
): DataRemovalRequest.Builder
```

Request service to remove data associated with a given [LocusId](https://developer.android.com/reference/kotlin/android/content/LocusId.html#).

|                                                                                                                                                                                                                                    Parameters                                                                                                                                                                                                                                     ||
|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `locusId` | [LocusId](https://developer.android.com/reference/kotlin/android/content/LocusId.html#): the [LocusId](https://developer.android.com/reference/kotlin/android/content/LocusId.html#) being requested to be removed. This value cannot be `null`.                                                                                                                                                                                                                       |
| `flags`   | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): either [DataRemovalRequest.FLAG_IS_PREFIX](https://developer.android.com/reference/kotlin/android/view/contentcapture/DataRemovalRequest#FLAG_IS_PREFIX:kotlin.Int) or `0` Value is either `0` or [android.view.contentcapture.DataRemovalRequest#FLAG_IS_PREFIX](https://developer.android.com/reference/kotlin/android/view/contentcapture/DataRemovalRequest#FLAG_IS_PREFIX:kotlin.Int) |

|                                                                                     Return                                                                                      ||
|--------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|
| [DataRemovalRequest.Builder](https://developer.android.com/reference/kotlin/android/view/contentcapture/DataRemovalRequest.Builder#) | this builder This value cannot be `null`. |

### build

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

```
fun build(): DataRemovalRequest
```

Builds the [DataRemovalRequest](https://developer.android.com/reference/kotlin/android/view/contentcapture/DataRemovalRequest).

|                                                                      Return                                                                       ||
|---------------------------------------------------------------------------------------------------------------------|------------------------------|
| [DataRemovalRequest](https://developer.android.com/reference/kotlin/android/view/contentcapture/DataRemovalRequest) | This value cannot be `null`. |

### forEverything

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

```
fun forEverything(): DataRemovalRequest.Builder
```

Requests servive to remove all content capture data associated with the app's package.

|                                                                                     Return                                                                                      ||
|--------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------|
| [DataRemovalRequest.Builder](https://developer.android.com/reference/kotlin/android/view/contentcapture/DataRemovalRequest.Builder#) | this builder This value cannot be `null`. |