FrequencyCapFilters


public final class FrequencyCapFilters
extends Object implements Parcelable

java.lang.Object
   ↳ android.adservices.common.FrequencyCapFilters


A container for the ad filters that are based on frequency caps.

No more than 20 frequency cap filters may be associated with a single ad.

Frequency caps filters combine an event type with a list of KeyedFrequencyCap objects to define a collection of ad filters. If any of these frequency caps are exceeded for a given ad, the ad will be removed from the group of ads submitted to a buyer adtech's bidding function.

Summary

Nested classes

class FrequencyCapFilters.Builder

Builder for creating FrequencyCapFilters objects. 

Constants

int AD_EVENT_TYPE_CLICK

int AD_EVENT_TYPE_IMPRESSION

int AD_EVENT_TYPE_VIEW

int AD_EVENT_TYPE_WIN

The WIN ad event type is automatically populated within the Protected Audience service for any winning ad which is returned from Protected Audience ad selection.

Inherited constants

Fields

public static final Creator<FrequencyCapFilters> CREATOR

Public methods

boolean equals(Object o)

Checks whether the FrequencyCapFilters objects contain the same information.

List<KeyedFrequencyCap> getKeyedFrequencyCapsForClickEvents()

Gets the list of KeyedFrequencyCap objects that will filter on the AD_EVENT_TYPE_CLICK event type.

List<KeyedFrequencyCap> getKeyedFrequencyCapsForImpressionEvents()

Gets the list of KeyedFrequencyCap objects that will filter on the AD_EVENT_TYPE_IMPRESSION event type.

List<KeyedFrequencyCap> getKeyedFrequencyCapsForViewEvents()

Gets the list of KeyedFrequencyCap objects that will filter on the AD_EVENT_TYPE_VIEW event type.

List<KeyedFrequencyCap> getKeyedFrequencyCapsForWinEvents()

Gets the list of KeyedFrequencyCap objects that will filter on the AD_EVENT_TYPE_WIN event type.

int hashCode()

Returns the hash of the FrequencyCapFilters object's data.

String toString()

Returns a string representation of the object.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Constants

AD_EVENT_TYPE_CLICK

public static final int AD_EVENT_TYPE_CLICK

Constant Value: 3 (0x00000003)

AD_EVENT_TYPE_IMPRESSION

public static final int AD_EVENT_TYPE_IMPRESSION

Constant Value: 1 (0x00000001)

AD_EVENT_TYPE_VIEW

public static final int AD_EVENT_TYPE_VIEW

Constant Value: 2 (0x00000002)

AD_EVENT_TYPE_WIN

public static final int AD_EVENT_TYPE_WIN

The WIN ad event type is automatically populated within the Protected Audience service for any winning ad which is returned from Protected Audience ad selection.

It should not be used to manually update an ad counter histogram.

Constant Value: 0 (0x00000000)

Fields

CREATOR

public static final Creator<FrequencyCapFilters> CREATOR

Public methods

equals

Added in API level 35
public boolean equals (Object o)

Checks whether the FrequencyCapFilters 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.

getKeyedFrequencyCapsForClickEvents

public List<KeyedFrequencyCap> getKeyedFrequencyCapsForClickEvents ()

Gets the list of KeyedFrequencyCap objects that will filter on the AD_EVENT_TYPE_CLICK event type.

These frequency caps apply to events which correlate to a click as interpreted by an adtech. Click events are counted when the AdSelectionManager.updateAdCounterHistogram(UpdateAdCounterHistogramRequest, Executor, OutcomeReceiver) API is invoked with the AD_EVENT_TYPE_CLICK event type.

Returns
List<KeyedFrequencyCap> This value cannot be null.

getKeyedFrequencyCapsForImpressionEvents

public List<KeyedFrequencyCap> getKeyedFrequencyCapsForImpressionEvents ()

Gets the list of KeyedFrequencyCap objects that will filter on the AD_EVENT_TYPE_IMPRESSION event type.

These frequency caps apply to events which correlate to an impression as interpreted by an adtech.

Note that events are not automatically counted when calling AdSelectionManager.reportImpression(ReportImpressionRequest, Executor, OutcomeReceiver). Instead, the AD_EVENT_TYPE_IMPRESSION event type must be updated using the AdSelectionManager.updateAdCounterHistogram(UpdateAdCounterHistogramRequest, Executor, OutcomeReceiver) API.

Returns
List<KeyedFrequencyCap> This value cannot be null.

getKeyedFrequencyCapsForViewEvents

public List<KeyedFrequencyCap> getKeyedFrequencyCapsForViewEvents ()

Gets the list of KeyedFrequencyCap objects that will filter on the AD_EVENT_TYPE_VIEW event type.

These frequency caps apply to events which correlate to a view as interpreted by an adtech. View events are counted when the AdSelectionManager.updateAdCounterHistogram(UpdateAdCounterHistogramRequest, Executor, OutcomeReceiver) API is invoked with the AD_EVENT_TYPE_VIEW event type.

Returns
List<KeyedFrequencyCap> This value cannot be null.

getKeyedFrequencyCapsForWinEvents

public List<KeyedFrequencyCap> getKeyedFrequencyCapsForWinEvents ()

Gets the list of KeyedFrequencyCap objects that will filter on the AD_EVENT_TYPE_WIN event type.

These frequency caps apply to events for ads that were selected as winners in ad selection. Winning ads are used to automatically increment the associated counter keys on the win event type.

Note that the AD_EVENT_TYPE_WIN event type cannot be updated manually using the AdSelectionManager.updateAdCounterHistogram(UpdateAdCounterHistogramRequest, Executor, OutcomeReceiver) API.

Returns
List<KeyedFrequencyCap> This value cannot be null.

hashCode

Added in API level 35
public int hashCode ()

Returns the hash of the FrequencyCapFilters 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 Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES