Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
A builder for EventLogRecord
Summary
Public constructors
Public methods
build
fun build(): EventLogRecord
Builds the instance. This builder should not be touched after calling this!
setData
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.
setType
fun setType(value: Int): EventLogRecord.Builder
The service-assigned identifier that identifies this payload. Each row in 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
. Must be >0 and <128. This allows up to 127 events to be written for each row in RequestLogRecord
. If unspecified, the default is 1.
Parameters |
value |
Int: Value is between 1 and 127 inclusive |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# EventLogRecord.Builder\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/adservices/ondevicepersonalization/EventLogRecord.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|------------------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.adservices.ondevicepersonalization.EventLogRecord.Builder](#) |\n\nA builder for [EventLogRecord](/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord)\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------|---|\n| [Builder](#Builder())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [EventLogRecord](/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord) | [build](#build())`()` Builds the instance. |\n| [EventLogRecord.Builder](#) | [setData](#setData(android.content.ContentValues))`(`value:` `[ContentValues](../../content/ContentValues.html#)?`)` Additional data to be logged. |\n| [EventLogRecord.Builder](#) | [setRequestLogRecord](#setRequestLogRecord(android.adservices.ondevicepersonalization.RequestLogRecord))`(`value:` `[RequestLogRecord](/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord)?`)` The existing [RequestLogRecord](/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord) that this payload should be associated with. |\n| [EventLogRecord.Builder](#) | [setRowIndex](#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](/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord) that this payload should be associated with. |\n| [EventLogRecord.Builder](#) | [setType](#setType(kotlin.Int))`(`value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` The service-assigned identifier that identifies this payload. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder()\n```\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): EventLogRecord\n```\n\nBuilds the instance. This builder should not be touched after calling this!\n\n| Return ||\n|-----------------------------------------------------------------------------------------------|------------------------------|\n| [EventLogRecord](/reference/kotlin/android/adservices/ondevicepersonalization/EventLogRecord) | This value cannot be `null`. |\n\n### setData\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setData(value: ContentValues?): EventLogRecord.Builder\n```\n\nAdditional 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.\n\n| Parameters ||\n|---------|--------------------------------------------------------------------------------|\n| `value` | [ContentValues](../../content/ContentValues.html#)?: This value may be `null`. |\n\n### setRequestLogRecord\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setRequestLogRecord(value: RequestLogRecord?): EventLogRecord.Builder\n```\n\nThe existing [RequestLogRecord](/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord) that this payload should be associated with. In an implementation of [IsolatedWorker.onExecute(ExecuteInput, android.os.OutcomeReceiver)](/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)](/reference/kotlin/android/adservices/ondevicepersonalization/LogReader#getRequests(java.time.Instant,%20java.time.Instant)). In an implementation of [IsolatedWorker.onEvent(EventInput, android.os.OutcomeReceiver)](/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](/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord).\n\n| Parameters ||\n|---------|-------------------------------------------------------------------------------------------------------------------------------|\n| `value` | [RequestLogRecord](/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord)?: This value may be `null`. |\n\n### setRowIndex\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setRowIndex(value: Int): EventLogRecord.Builder\n```\n\nThe index of the row in an existing [RequestLogRecord](/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord) that this payload should be associated with.\n\n| Parameters ||\n|---------|---------------------------------------------------------------------------------------------------|\n| `value` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is 0 or greater |\n\n| Return ||\n|-----------------------------|------------------------------|\n| [EventLogRecord.Builder](#) | This value cannot be `null`. |\n\n### setType\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setType(value: Int): EventLogRecord.Builder\n```\n\nThe service-assigned identifier that identifies this payload. Each row in [RequestLogRecord](/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](/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord). Must be \\\u003e0 and \\\u003c128. This allows up to 127 events to be written for each row in [RequestLogRecord](/reference/kotlin/android/adservices/ondevicepersonalization/RequestLogRecord). If unspecified, the default is 1.\n\n| Parameters ||\n|---------|------------------------------------------------------------------------------------------------------------------|\n| `value` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is between 1 and 127 inclusive |\n\n| Return ||\n|-----------------------------|------------------------------|\n| [EventLogRecord.Builder](#) | This value cannot be `null`. |"]]