KeyedFrequencyCap.Builder

public static final class KeyedFrequencyCap.Builder
extends Object

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


用于创建 KeyedFrequencyCap 对象的构建器。

摘要

公共构造函数

Builder(int adCounterKey, int maxCount, Duration interval)

公共方法

KeyedFrequencyCap build()

构建并返回 KeyedFrequencyCap 实例。

KeyedFrequencyCap.Builder setAdCounterKey(int adCounterKey)

设置应用频次上限的广告计数器键。

KeyedFrequencyCap.Builder setInterval(Duration interval)

将间隔时间设置为 Duration(将截断为最接近的秒数)。 系统据此计算频次上限

KeyedFrequencyCap.Builder setMaxCount(int maxCount)

针对频次上限设置在相应时间间隔内的数量上限。

继承的方法

Object clone()

创建并返回此对象的副本。

boolean equals(Object obj)

指示某个其他对象是否“等于”这个。

void finalize()

垃圾回收时,由垃圾回收器针对对象调用 确定没有对对象的更多引用。

final Class<?> getClass()

返回此 Object 的运行时类。

int hashCode()

返回对象的哈希代码值。

final void notify()

唤醒正在等待此对象的 监控。

final void notifyAll()

唤醒正在等待此对象的监控器的所有线程。

String toString()

返回对象的字符串表示。

final void wait(long timeoutMillis, int nanos)

导致当前线程处于等待状态,直到其被唤醒,这通常是 通知中断,或者直到 经过了一定量的实时。

final void wait(long timeoutMillis)

导致当前线程处于等待状态,直到其被唤醒,这通常是 通知中断,或者直到 经过了一定量的实时。

final void wait()

导致当前线程处于等待状态,直到其被唤醒,这通常是 通知中断

公共构造函数

Builder

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

参数
adCounterKey int

maxCount int

interval Duration:此值不能为 null

公共方法

build

public KeyedFrequencyCap build ()

构建并返回 KeyedFrequencyCap 实例。

返回
KeyedFrequencyCap 此值不能为 null

setAdCounterKey

public KeyedFrequencyCap.Builder setAdCounterKey (int adCounterKey)

设置应用频次上限的广告计数器键。

如需了解详情,请参阅 KeyedFrequencyCap.getAdCounterKey()

参数
adCounterKey int

返回值
KeyedFrequencyCap.Builder 此值不能为 null

setInterval

public KeyedFrequencyCap.Builder setInterval (Duration interval)

将间隔时间设置为 Duration(将截断为最接近的秒数),系统根据这一时间来计算频次上限。

如需了解详情,请参阅 KeyedFrequencyCap.getInterval()

参数
interval Duration:此值不能为 null

返回值
KeyedFrequencyCap.Builder 此值不能为 null

setMaxCount

public KeyedFrequencyCap.Builder setMaxCount (int maxCount)

针对频次上限设置在相应时间间隔内的数量上限。

如需了解详情,请参阅 KeyedFrequencyCap.getMaxCount()

参数
maxCount int

返回值
KeyedFrequencyCap.Builder 此值不能为 null