Builder


class Builder
kotlin.Any
   ↳ android.adservices.common.AdData.Builder

Builder for AdData objects.

Summary

Public constructors

Public methods
AdData

Builds the AdData object.

AdData.Builder
setAdCounterKeys(adCounterKeys: MutableSet<Int!>)

Sets the set of keys used in counting events.

AdData.Builder
setAdFilters(adFilters: AdFilters?)

Sets all AdFilters associated with the ad.

AdData.Builder
setAdRenderId(adRenderId: String?)

Sets the ad render id for server auction

AdData.Builder
setMetadata(metadata: String)

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

AdData.Builder
setRenderUri(renderUri: Uri)

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

Public constructors

Builder

Builder()

Public methods

build

fun build(): AdData

Builds the AdData object.

Return
AdData This value cannot be null.
Exceptions
java.lang.NullPointerException if any required parameters are null when built

setAdCounterKeys

fun setAdCounterKeys(adCounterKeys: MutableSet<Int!>): AdData.Builder

Sets the set of keys used in counting events.

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

See getAdCounterKeys() for more information.

Parameters
adCounterKeys MutableSet<Int!>: This value cannot be null.
Return
AdData.Builder This value cannot be null.

setAdFilters

fun setAdFilters(adFilters: AdFilters?): AdData.Builder

Sets all AdFilters associated with the ad.

See getAdFilters() for more information.

Parameters
adFilters AdFilters?: This value may be null.
Return
AdData.Builder This value cannot be null.

setAdRenderId

fun setAdRenderId(adRenderId: String?): AdData.Builder

Sets the ad render id for server auction

See AdData#getAdRenderId() for more information.

Parameters
adRenderId String?: This value may be null.
Return
AdData.Builder This value cannot be null.

setMetadata

fun setMetadata(metadata: String): AdData.Builder

Sets 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.

See getMetadata() for detail.

Parameters
metadata String: This value cannot be null.
Return
AdData.Builder This value cannot be null.

setRenderUri

fun setRenderUri(renderUri: Uri): AdData.Builder

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

See getRenderUri() for detail.

Parameters
renderUri Uri: This value cannot be null.
Return
AdData.Builder This value cannot be null.