Builder


class Builder
kotlin.Any
   ↳ android.adservices.common.KeyedFrequencyCap.Builder

Builder for creating KeyedFrequencyCap objects.

Summary

Public constructors
Builder(adCounterKey: Int, maxCount: Int, interval: Duration)

Public methods
KeyedFrequencyCap

Builds and returns a KeyedFrequencyCap instance.

KeyedFrequencyCap.Builder
setAdCounterKey(adCounterKey: Int)

Sets the ad counter key the frequency cap applies to.

KeyedFrequencyCap.Builder
setInterval(interval: Duration)

Sets the interval, as a Duration which will be truncated to the nearest second, over which the frequency cap is calculated.

KeyedFrequencyCap.Builder
setMaxCount(maxCount: Int)

Sets the maximum count within the time interval for the frequency cap.

Public constructors

Builder

Builder(
    adCounterKey: Int,
    maxCount: Int,
    interval: Duration)
Parameters
interval Duration: This value cannot be null.

Public methods

build

fun build(): KeyedFrequencyCap

Builds and returns a KeyedFrequencyCap instance.

Return
KeyedFrequencyCap This value cannot be null.

setAdCounterKey

fun setAdCounterKey(adCounterKey: Int): KeyedFrequencyCap.Builder

Sets the ad counter key the frequency cap applies to.

See getAdCounterKey() for more information.

Return
KeyedFrequencyCap.Builder This value cannot be null.

setInterval

fun setInterval(interval: Duration): KeyedFrequencyCap.Builder

Sets the interval, as a Duration which will be truncated to the nearest second, over which the frequency cap is calculated.

See getInterval() for more information.

Parameters
interval Duration: This value cannot be null.
Return
KeyedFrequencyCap.Builder This value cannot be null.

setMaxCount

fun setMaxCount(maxCount: Int): KeyedFrequencyCap.Builder

Sets the maximum count within the time interval for the frequency cap.

See getMaxCount() for more information.

Return
KeyedFrequencyCap.Builder This value cannot be null.