KeyedFrequencyCap.Builder
public
static
final
class
KeyedFrequencyCap.Builder
extends Object
| java.lang.Object | |
| ↳ | android.adservices.common.KeyedFrequencyCap.Builder |
This class was deprecated
in API level 37.
The Rubidium (Rb) Relevance APIs, including those in android.adservices.common,
are being deprecated. Relevance APIs have no direct replacement. Developers should stop
using them, as calls will be rejected in future Android releases. Please refer to
official Privacy Sandbox documentation for deprecation and roadmap details:
https://privacysandbox.com/news/update-on-plans-for-privacy-sandbox-technologies/
Builder for creating KeyedFrequencyCap objects.
Summary
Public constructors | |
|---|---|
Builder(int adCounterKey, int maxCount, Duration interval)
|
|
Public methods | |
|---|---|
KeyedFrequencyCap
|
build()
Builds and returns a |
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 |
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. |