UpdateAdCounterHistogramRequest

public class UpdateAdCounterHistogramRequest
extends Object

java.lang.Object
   ↳ android.adservices.adselection.UpdateAdCounterHistogramRequest


Request object wrapping the required arguments needed to update an ad counter histogram.

The ad counter histograms, which are historical logs of events which are associated with an ad counter key and an ad event type, are used to inform frequency cap filtering when using the Protected Audience APIs.

Summary

Nested classes

class UpdateAdCounterHistogramRequest.Builder

Builder for UpdateAdCounterHistogramRequest objects. 

Public methods

boolean equals(Object o)

Checks whether the UpdateAdCounterHistogramRequest objects contain the same information.

int getAdEventType()

Gets the ad event type which, along with an ad's counter keys, identifies which histogram should be updated.

long getAdSelectionId()

Gets the ad selection ID with which the rendered ad's events are associated.

AdTechIdentifier getCallerAdTech()

Gets the caller adtech entity's AdTechIdentifier.

int hashCode()

Returns the hash of the UpdateAdCounterHistogramRequest object's data.

String toString()

Returns a string representation of the object.

Inherited methods

Public methods

equals

public boolean equals (Object o)

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

getAdEventType

public int getAdEventType ()

Gets the ad event type which, along with an ad's counter keys, identifies which histogram should be updated.

Returns
int Value is android.adservices.common.FrequencyCapFilters.AD_EVENT_TYPE_INVALID, FrequencyCapFilters.AD_EVENT_TYPE_WIN, FrequencyCapFilters.AD_EVENT_TYPE_IMPRESSION, FrequencyCapFilters.AD_EVENT_TYPE_VIEW, FrequencyCapFilters.AD_EVENT_TYPE_CLICK, android.adservices.common.FrequencyCapFilters.AD_EVENT_TYPE_MIN, or android.adservices.common.FrequencyCapFilters.AD_EVENT_TYPE_MAX

getAdSelectionId

public long getAdSelectionId ()

Gets the ad selection ID with which the rendered ad's events are associated.

For more information about the ad selection ID, see AdSelectionOutcome.

The ad must have been selected from Protected Audience ad selection in the last 24 hours, and the ad selection call must have been initiated from the same app as the current calling app. Event histograms for all ad counter keys associated with the ad specified by the ad selection ID will be updated for the ad event type from getAdEventType(), to be used in Protected Audience frequency cap filtering.

Returns
long

getCallerAdTech

public AdTechIdentifier getCallerAdTech ()

Gets the caller adtech entity's AdTechIdentifier.

The adtech using this UpdateAdCounterHistogramRequest object must have enrolled with the Privacy Sandbox and be allowed to act on behalf of the calling app. The specified adtech is not required to be the same adtech as either the buyer which owns the rendered ad or the seller which initiated the ad selection associated with the ID returned by getAdSelectionId().

For more information about API requirements and exceptions, see AdSelectionManager.updateAdCounterHistogram(android.adservices.adselection.UpdateAdCounterHistogramRequest, java.util.concurrent.Executor, android.os.OutcomeReceiver).

Returns
AdTechIdentifier This value cannot be null.

hashCode

public int hashCode ()

Returns the hash of the UpdateAdCounterHistogramRequest object's data.

Returns
int a hash code value for this object.

toString

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
String a string representation of the object.