EventLogRecord.Builder


public static final class EventLogRecord.Builder
extends Object

java.lang.Object
   ↳ android.adservices.ondevicepersonalization.EventLogRecord.Builder


A builder for EventLogRecord

Summary

Public constructors

Builder()

Public methods

EventLogRecord build()

Builds the instance.

EventLogRecord.Builder setData(ContentValues value)

Additional data to be logged.

EventLogRecord.Builder setRequestLogRecord(RequestLogRecord value)

The existing RequestLogRecord that this payload should be associated with.

EventLogRecord.Builder setRowIndex(int value)

The index of the row in an existing RequestLogRecord that this payload should be associated with.

EventLogRecord.Builder setType(int value)

The service-assigned identifier that identifies this payload.

Inherited methods

Public constructors

Builder

Added in API level 35
public Builder ()

Public methods

build

Added in API level 35
public EventLogRecord build ()

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

Returns
EventLogRecord This value cannot be null.

setData

Added in API level 35
public EventLogRecord.Builder setData (ContentValues value)

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: This value may be null.

Returns
EventLogRecord.Builder

setRequestLogRecord

Added in API level 35
public EventLogRecord.Builder setRequestLogRecord (RequestLogRecord value)

The existing RequestLogRecord that this payload should be associated with. In an implementation of IsolatedWorker.onExecute(ExecuteInput, android.os.OutcomeReceiver), this should be set to a value returned by LogReader.getRequests(Instant, Instant). In an implementation of IsolatedWorker.onEvent(EventInput, android.os.OutcomeReceiver), this should be set to null because the payload will be automatically associated with the current RequestLogRecord.

Parameters
value RequestLogRecord: This value may be null.

Returns
EventLogRecord.Builder

setRowIndex

Added in API level 35
public EventLogRecord.Builder setRowIndex (int value)

The index of the row in an existing RequestLogRecord that this payload should be associated with.

Parameters
value int: Value is 0 or greater

Returns
EventLogRecord.Builder This value cannot be null.

setType

Added in API level 35
public EventLogRecord.Builder setType (int value)

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

Returns
EventLogRecord.Builder This value cannot be null.