KeyedFrequencyCap.Builder


public static final class KeyedFrequencyCap.Builder
extends Object

java.lang.Object
   ↳ android.adservices.common.KeyedFrequencyCap.Builder


Builder for creating KeyedFrequencyCap objects.

Summary

Public constructors

Builder(int adCounterKey, int maxCount, Duration interval)

Public methods

KeyedFrequencyCap build()

Builds and returns a KeyedFrequencyCap instance.

KeyedFrequencyCap.Builder setAdCounterKey(int adCounterKey)

Sets the ad counter key the frequency cap applies to.

KeyedFrequencyCap.Builder setInterval(Duration interval)

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

KeyedFrequencyCap.Builder setMaxCount(int maxCount)

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

Inherited methods

Public constructors

Builder

public Builder (int adCounterKey, 
                int maxCount, 
                Duration interval)

Parameters
adCounterKey int

maxCount int

interval Duration: This value cannot be null.

Public methods

build

public KeyedFrequencyCap build ()

Builds and returns a KeyedFrequencyCap instance.

Returns
KeyedFrequencyCap This value cannot be null.

setAdCounterKey

public KeyedFrequencyCap.Builder setAdCounterKey (int adCounterKey)

Sets the ad counter key the frequency cap applies to.

See KeyedFrequencyCap.getAdCounterKey() for more information.

Parameters
adCounterKey int

Returns
KeyedFrequencyCap.Builder This value cannot be null.

setInterval

public KeyedFrequencyCap.Builder setInterval (Duration interval)

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

See KeyedFrequencyCap.getInterval() for more information.

Parameters
interval Duration: This value cannot be null.

Returns
KeyedFrequencyCap.Builder This value cannot be null.

setMaxCount

public KeyedFrequencyCap.Builder setMaxCount (int maxCount)

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

See KeyedFrequencyCap.getMaxCount() for more information.

Parameters
maxCount int

Returns
KeyedFrequencyCap.Builder This value cannot be null.