# ExecuteOutput.Builder

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

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/adservices/ondevicepersonalization/ExecuteOutput.Builder "View this page in Java")  

```
class Builder
```

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

A builder for[ExecuteOutput](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput)

## Summary

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

|                                                                                                                                                                                                                                                                                                                                                                                                                                              Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                               ||
|-------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ExecuteOutput.Builder](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput.Builder#) | [addEventLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput.Builder#addEventLogRecord(android.adservices.ondevicepersonalization.EventLogRecord))`(`value:` `[EventLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord)`)` <br />                                                                                                                                                                                                                                                                                                                                                                                              |
| [ExecuteOutput](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput)                  | [build](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput.Builder#build())`()` Builds the instance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [ExecuteOutput.Builder](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput.Builder#) | [setBestValue](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput.Builder#setBestValue(kotlin.Int))`(`value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` An integer value that an[IsolatedService](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedService)may optionally return to a calling app, by setting this field to the value between 0 and[android.adservices.ondevicepersonalization.ExecuteInIsolatedServiceRequest.OutputSpec#getMaxIntValue()](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteInIsolatedServiceRequest.OutputSpec#getMaxIntValue()). |
| [ExecuteOutput.Builder](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput.Builder#) | [setEventLogRecords](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput.Builder#setEventLogRecords(kotlin.collections.MutableList))`(`value:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)<[EventLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord)!>`)` A list of[EventLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord)objects to be written to the EVENTS table.                                                                                                                                      |
| [ExecuteOutput.Builder](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput.Builder#) | [setOutputData](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput.Builder#setOutputData(kotlin.Byte))`(`vararg` `value:` `[Byte](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte/index.html)`)` A byte array that an[IsolatedService](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedService)may optionally return to a calling app, by setting this field to a non-null value.                                                                                                                                                                                                                                                             |
| [ExecuteOutput.Builder](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput.Builder#) | [setRenderingConfig](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput.Builder#setRenderingConfig(android.adservices.ondevicepersonalization.RenderingConfig))`(`value:` `[RenderingConfig](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/RenderingConfig)?`)` A[RenderingConfig](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/RenderingConfig)object that contains information about the content to be rendered in the client app view.                                                                                                                                                                        |
| [ExecuteOutput.Builder](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput.Builder#) | [setRequestLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput.Builder#setRequestLogRecord(android.adservices.ondevicepersonalization.RequestLogRecord))`(`value:` `[RequestLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord)?`)` Persistent data to be written to the REQUESTS table after[IsolatedWorker.onExecute(ExecuteInput, android.os.OutcomeReceiver)](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedWorker#onExecute(android.adservices.ondevicepersonalization.ExecuteInput,%20android.os.OutcomeReceiver))completes.                                       |

## Public constructors

### Builder

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

```
Builder()
```

## Public methods

### addEventLogRecord

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

```
fun addEventLogRecord(value: EventLogRecord): ExecuteOutput.Builder
```

|                                                                           Parameters                                                                            ||
|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| `value` | [EventLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord):This value cannot be`null`. |

|                                                                                 Return                                                                                 ||
|-------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ExecuteOutput.Builder](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput.Builder#) | This value cannot be`null`. |

**See Also**

- [#setEventLogRecords](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput.Builder#setEventLogRecords(kotlin.collections.MutableList))  

### build

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

```
fun build(): ExecuteOutput
```

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

|                                                                        Return                                                                         ||
|--------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ExecuteOutput](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput) | This value cannot be`null`. |

### setBestValue

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

```
fun setBestValue(value: Int): ExecuteOutput.Builder
```

An integer value that an[IsolatedService](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedService)may optionally return to a calling app, by setting this field to the value between 0 and[android.adservices.ondevicepersonalization.ExecuteInIsolatedServiceRequest.OutputSpec#getMaxIntValue()](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteInIsolatedServiceRequest.OutputSpec#getMaxIntValue()). The noise will be added to the value of this field before returned to the caller of[android.adservices.ondevicepersonalization.OnDevicePersonalizationManager#executeInIsolatedService](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/OnDevicePersonalizationManager#executeInIsolatedService(android.adservices.ondevicepersonalization.ExecuteInIsolatedServiceRequest,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver)). In order to get this field, the (calling app package, isolated service package) pair must be present in an allowlist that permits data to be returned and[android.adservices.ondevicepersonalization.ExecuteInIsolatedServiceRequest.OutputSpec#buildBestValueSpec](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteInIsolatedServiceRequest.OutputSpec#buildBestValueSpec(kotlin.Int))is set.

|                                                Parameters                                                 ||
|---------|--------------------------------------------------------------------------------------------------|
| `value` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is 0 or greater |

|                                                                                 Return                                                                                 ||
|-------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ExecuteOutput.Builder](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput.Builder#) | This value cannot be`null`. |

### setEventLogRecords

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

```
fun setEventLogRecords(value: MutableList<EventLogRecord!>): ExecuteOutput.Builder
```

A list of[EventLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord)objects to be written to the EVENTS table. Each[EventLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord)must be associated with an existing[RequestLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord)in the REQUESTS table, specified using[EventLogRecord.Builder.setRequestLogRecord(RequestLogRecord)](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord.Builder#setRequestLogRecord(android.adservices.ondevicepersonalization.RequestLogRecord)). If the[RequestLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord)is not specified, the[EventLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord)will not be written.

|                                                                                                                                 Parameters                                                                                                                                  ||
|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `value` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[EventLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord)!\>:This value cannot be`null`. |

|                                                                                 Return                                                                                 ||
|-------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ExecuteOutput.Builder](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/ExecuteOutput.Builder#) | This value cannot be`null`. |

### setOutputData

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

```
fun setOutputData(vararg value: Byte): ExecuteOutput.Builder
```

A byte array that an[IsolatedService](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedService)may optionally return to a calling app, by setting this field to a non-null value. The contents of this array will be returned to the caller of[OnDevicePersonalizationManager.execute(ComponentName,](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/OnDevicePersonalizationManager#execute(android.content.ComponentName,%20android.os.PersistableBundle,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver))if returning data from isolated processes is allowed by policy and the (calling app package, isolated service package) pair is present in an allowlist that permits data to be returned.

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

### setRenderingConfig

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

```
fun setRenderingConfig(value: RenderingConfig?): ExecuteOutput.Builder
```

A[RenderingConfig](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/RenderingConfig)object that contains information about the content to be rendered in the client app view. Can be null if no content is to be rendered.

|                                                                           Parameters                                                                            ||
|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| `value` | [RenderingConfig](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/RenderingConfig)?:This value may be`null`. |

### setRequestLogRecord

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

```
fun setRequestLogRecord(value: RequestLogRecord?): ExecuteOutput.Builder
```

Persistent data to be written to the REQUESTS table after[IsolatedWorker.onExecute(ExecuteInput, android.os.OutcomeReceiver)](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedWorker#onExecute(android.adservices.ondevicepersonalization.ExecuteInput,%20android.os.OutcomeReceiver))completes. If null, no persistent data will be written.

|                                                                            Parameters                                                                             ||
|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `value` | [RequestLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord)?:This value may be`null`. |