AdData


class AdData : Parcelable
kotlin.Any
   ↳ android.adservices.common.AdData

Represents data specific to an ad that is necessary for ad selection and rendering.

Summary

Nested classes

Builder for AdData objects.

Inherited constants
Public methods
Boolean
equals(other: Any?)

Checks whether two AdData objects contain the same information.

MutableSet<Int!>

Gets the set of keys used in counting events.

AdFilters?

Gets all AdFilters associated with the ad.

String?

Gets the ad render id for server auctions.

String

Gets the buyer ad metadata used during the ad selection process.

Uri

Gets the URI that points to the ad's rendering assets.

Int

Returns the hash of the AdData object's data.

String

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<AdData!>

Public methods

equals

Added in API level 34
fun equals(other: Any?): Boolean

Checks whether two AdData objects contain the same information.

Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getAdCounterKeys

fun getAdCounterKeys(): MutableSet<Int!>

Gets the set of keys used in counting events.

No more than 10 ad counter keys may be associated with an ad.

The keys and counts per key are used in frequency cap filtering during ad selection to disqualify associated ads from being submitted to bidding.

Note that these keys can be overwritten along with the ads and other bidding data for a custom audience during the custom audience's daily update.

Return
MutableSet<Int!> This value cannot be null.

getAdFilters

fun getAdFilters(): AdFilters?

Gets all AdFilters associated with the ad.

The filters, if met or exceeded, exclude the associated ad from participating in ad selection. They are optional and if null specify that no filters apply to this ad.

getAdRenderId

fun getAdRenderId(): String?

Gets the ad render id for server auctions.

Ad render id is collected for each AdData when server auction request is received.

Any AdData without ad render id will be ineligible for server-side auction.

The overall size of the CA is limited. The size of this field is considered using String#getBytes() in UTF-8 encoding.

Return
String? This value may be null.

getMetadata

fun getMetadata(): String

Gets the buyer ad metadata used during the ad selection process.

The metadata should be a valid JSON object serialized as a string. Metadata represents ad-specific bidding information that will be used during ad selection as part of bid generation and used in buyer JavaScript logic, which is executed in an isolated execution environment.

If the metadata is not a valid JSON object that can be consumed by the buyer's JS, the ad will not be eligible for ad selection.

Return
String This value cannot be null.

getRenderUri

fun getRenderUri(): Uri

Gets the URI that points to the ad's rendering assets. The URI must use HTTPS.

Return
Uri This value cannot be null.

hashCode

Added in API level 34
fun hashCode(): Int

Returns the hash of the AdData object's data.

Return
Int a hash code value for this object.

toString

Added in API level 34
fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 34
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

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_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

static val CREATOR: Parcelable.Creator<AdData!>