public
final
class
KeyedFrequencyCap
extends Object
implements
Parcelable
A frequency cap for a specific ad counter key.
Frequency caps define the maximum rate an event can occur within a given time interval. If the frequency cap is exceeded, the associated ad will be filtered out of ad selection.
Summary
Nested classes | |
|---|---|
class |
KeyedFrequencyCap.Builder
Builder for creating |
Inherited constants | ||||
|---|---|---|---|---|
|
From interface
|
Fields | |
|---|---|
public
static
final
Creator<KeyedFrequencyCap> |
CREATOR
|
Public methods | |
|---|---|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
boolean
|
equals(Object o)
Checks whether the |
int
|
getAdCounterKey()
Returns the ad counter key that the frequency cap is applied to. |
Duration
|
getInterval()
Returns the interval, as a |
int
|
getMaxCount()
Returns the maximum count of event occurrences allowed within a given time interval. |
int
|
hashCode()
Returns the hash of the |
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
From class
| |||||||||||||||||||||||
|
From interface
| |||||||||||||||||||||||
Fields
CREATOR
Added in API level 35
Also in Ad Services Extensions 8
public static final Creator<KeyedFrequencyCap> CREATOR
Public methods
describeContents
Added in API level 35
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(Parcel,int),
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR bit.
| Returns | |
|---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or
|
equals
Added in API level 35
public boolean equals (Object o)
Checks whether the KeyedFrequencyCap objects contain the same information.
| Parameters | |
|---|---|
o |
Object: the reference object with which to compare. |
| Returns | |
|---|---|
boolean |
true if this object is the same as the obj
argument; false otherwise. |
getAdCounterKey
Added in API level 35
Also in Ad Services Extensions 8
public int getAdCounterKey ()
Returns the ad counter key that the frequency cap is applied to.
The ad counter key is defined by an adtech and is an arbitrary numeric identifier which defines any criteria which may have previously been counted and persisted on the device. If the on-device count exceeds the maximum count within a certain time interval, the frequency cap has been exceeded.
| Returns | |
|---|---|
int |
This value cannot be null. |
getInterval
Added in API level 35
Also in Ad Services Extensions 8
public Duration getInterval ()
Returns the interval, as a Duration which will be truncated to the nearest second,
over which the frequency cap is calculated.
When this frequency cap is computed, the number of persisted events is counted in the most
recent time interval. If the count of previously occurring matching events for an adtech is
greater than the number returned by getMaxCount(), the frequency cap has been
exceeded, and the ad will not be eligible for ad selection.
| Returns | |
|---|---|
Duration |
This value cannot be null. |
getMaxCount
Added in API level 35
Also in Ad Services Extensions 8
public int getMaxCount ()
Returns the maximum count of event occurrences allowed within a given time interval.
If there are more events matching the ad counter key and ad event type counted on the
device within the time interval defined by getInterval(), the frequency cap has been
exceeded, and the ad will not be eligible for ad selection.
For example, an ad that specifies a filter for a max count of two within one hour will not be eligible for ad selection if the event has been counted two or more times within the hour preceding the ad selection process.
| Returns | |
|---|---|
int |
|
hashCode
Added in API level 35
public int hashCode ()
Returns the hash of the KeyedFrequencyCap object's data.
| Returns | |
|---|---|
int |
a hash code value for this object. |
toString
Added in API level 35
public String toString ()
Returns a string representation of the object.
| Returns | |
|---|---|
String |
a string representation of the object. |
writeToParcel
Added in API level 35
public void writeToParcel (Parcel dest, int flags)
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
dest |
Parcel: This value cannot be null. |
flags |
int: Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following:
|