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

# Builder

*** ** * ** ***

```
class Builder
```

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

*** ** * ** ***

> [!CAUTION]
> **This class was deprecated in API level 37.**
>
> The ODP APIs are deprecated and will not be supported in future Android releases. There is no direct replacement API available. Developers currently integrated with these APIs must cease further integration efforts. For comprehensive details regarding this deprecation and the future roadmap of Privacy Sandbox on Android, please consult the official Privacy Sandbox developer documentation and announcements: <https://privacysandbox.google.com>

A builder for `https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/DownloadCompletedOutput`

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/DownloadCompletedOutput.Builder#Builder()()` <br /> |

| Public methods ||
|---|---|
| [DownloadCompletedOutput.Builder](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/DownloadCompletedOutput.Builder#) | `https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/DownloadCompletedOutput.Builder#addRetainedKey(kotlin.String)(value: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` <br /> |
| [DownloadCompletedOutput](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/DownloadCompletedOutput) | `https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/DownloadCompletedOutput.Builder#build()()` Builds the instance. |
| [DownloadCompletedOutput.Builder](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/DownloadCompletedOutput.Builder#) | `https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/DownloadCompletedOutput.Builder#setRetainedKeys(kotlin.collections.MutableList)(value: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!>)` The keys to be retained in the REMOTE_DATA table. |

## Public constructors

### Builder

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

```
Builder()
```

## Public methods

### addRetainedKey

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

```
fun addRetainedKey(value: String): DownloadCompletedOutput.Builder
```

**Deprecated:** *Deprecated in Java.*

| Parameters ||
|---|---|
| `value` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/DownloadCompletedOutput.Builder#` | This value cannot be `null`. |

**See Also**

- `https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/DownloadCompletedOutput.Builder#setRetainedKeys(kotlin.collections.MutableList)`

### build

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

```
fun build(): DownloadCompletedOutput
```

**Deprecated:** *Deprecated in Java.*

Builds the instance. This builder should not be touched after calling this!

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/DownloadCompletedOutput` | This value cannot be `null`. |

### setRetainedKeys

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

```
fun setRetainedKeys(value: MutableList<String!>): DownloadCompletedOutput.Builder
```

**Deprecated:** *Deprecated in Java.*

The keys to be retained in the REMOTE_DATA table. Any existing keys that are not present in this list are removed from the table.

| Parameters ||
|---|---|
| `value` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>: This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/DownloadCompletedOutput.Builder#` | This value cannot be `null`. |