AdData.Builder

public static final class AdData.Builder
extends Object

java.lang.Object
   ↳ android.adservices.common.AdData.Builder


Builder for AdData objects.

Summary

Public constructors

Builder()

Public methods

AdData build()

Builds the AdData object.

AdData.Builder setMetadata(String metadata)

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

AdData.Builder setRenderUrl(Uri renderUrl)

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

Inherited methods

Public constructors

Builder

public Builder ()

Public methods

build

public AdData build ()

Builds the AdData object.

Returns
AdData This value cannot be null.

Throws
NullPointerException if any parameters are null when built

setMetadata

public AdData.Builder setMetadata (String metadata)

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 AdData.getMetadata() for detail.

Parameters
metadata String: This value cannot be null.

Returns
AdData.Builder This value cannot be null.

setRenderUrl

public AdData.Builder setRenderUrl (Uri renderUrl)

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

See AdData.getRenderUrl() for detail.

Parameters
renderUrl Uri: This value cannot be null.

Returns
AdData.Builder This value cannot be null.