# EventLogRecord.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/EventLogRecord.Builder "View this page in Java")  

```
class Builder
```

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

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

## Summary

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

|                                                                                                                                                                                                                                                                                                                                               Public methods                                                                                                                                                                                                                                                                                                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [EventLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord)                  | [build](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord.Builder#build())`()` Builds the instance.                                                                                                                                                                                                                                                                                                                                                                                                    |
| [EventLogRecord.Builder](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord.Builder#) | [setData](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord.Builder#setData(android.content.ContentValues))`(`value:` `[ContentValues](https://developer.android.com/reference/kotlin/android/content/ContentValues.html#)?`)` Additional data to be logged.                                                                                                                                                                                                                                           |
| [EventLogRecord.Builder](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord.Builder#) | [setRequestLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord.Builder#setRequestLogRecord(android.adservices.ondevicepersonalization.RequestLogRecord))`(`value:` `[RequestLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord)?`)` The existing[RequestLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord)that this payload should be associated with. |
| [EventLogRecord.Builder](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord.Builder#) | [setRowIndex](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord.Builder#setRowIndex(kotlin.Int))`(`value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` The index of the row in an existing[RequestLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord)that this payload should be associated with.                                                                                                |
| [EventLogRecord.Builder](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord.Builder#) | [setType](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord.Builder#setType(kotlin.Int))`(`value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` The service-assigned identifier that identifies this payload.                                                                                                                                                                                                                                                        |

## Public constructors

### Builder

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

```
Builder()
```

## Public methods

### build

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

```
fun build(): EventLogRecord
```

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

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

### setData

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

```
fun setData(value: ContentValues?): EventLogRecord.Builder
```

Additional data to be logged. Can be null if no additional data needs to be written as part of the event, and only the occurrence of the event needs to be logged.

|                                                               Parameters                                                               ||
|---------|-------------------------------------------------------------------------------------------------------------------------------|
| `value` | [ContentValues](https://developer.android.com/reference/kotlin/android/content/ContentValues.html#)?: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?): EventLogRecord.Builder
```

The existing[RequestLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord)that this payload should be associated with. In an implementation of[IsolatedWorker.onExecute(ExecuteInput, android.os.OutcomeReceiver)](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedWorker#onExecute(android.adservices.ondevicepersonalization.ExecuteInput,%20android.os.OutcomeReceiver)), this should be set to a value returned by[LogReader.getRequests(Instant, Instant)](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/LogReader#getRequests(java.time.Instant,%20java.time.Instant)). In an implementation of[IsolatedWorker.onEvent(EventInput, android.os.OutcomeReceiver)](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/IsolatedWorker#onEvent(android.adservices.ondevicepersonalization.EventInput,%20android.os.OutcomeReceiver)), this should be set to`null`because the payload will be automatically associated with the current[RequestLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord).

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

### setRowIndex

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

```
fun setRowIndex(value: Int): EventLogRecord.Builder
```

The index of the row in an existing[RequestLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord)that this payload should be associated with.

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

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

### setType

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

```
fun setType(value: Int): EventLogRecord.Builder
```

The service-assigned identifier that identifies this payload. Each row in[RequestLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord)can be associated with up to one event of a specified type. The platform drops events if another event with the same type already exists for a row in[RequestLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord). Must be \>0 and \<128. This allows up to 127 events to be written for each row in[RequestLogRecord](https://developer.android.com/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord). If unspecified, the default is 1.

|                                                        Parameters                                                        ||
|---------|-----------------------------------------------------------------------------------------------------------------|
| `value` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Value is between 1 and 127 inclusive |

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