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 setAdCounterKeys(Set<Integer> adCounterKeys)

Sets the set of keys used in counting events.

AdData.Builder setAdFilters(AdFilters adFilters)

Sets all AdFilters associated with the ad.

AdData.Builder setAdRenderId(String adRenderId)

Sets the ad render id for server auction

See AdData.getAdRenderId() for more information.

AdData.Builder setMetadata(String metadata)

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

AdData.Builder setRenderUri(Uri renderUri)

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

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

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 required parameters are null when built

setAdCounterKeys

public AdData.Builder setAdCounterKeys (Set<Integer> adCounterKeys)

Sets the set of keys used in counting events.

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

See AdData.getAdCounterKeys() for more information.

Parameters
adCounterKeys Set: This value cannot be null.

Returns
AdData.Builder This value cannot be null.

setAdFilters

public AdData.Builder setAdFilters (AdFilters adFilters)

Sets all AdFilters associated with the ad.

See AdData.getAdFilters() for more information.

Parameters
adFilters AdFilters: This value may be null.

Returns
AdData.Builder This value cannot be null.

setAdRenderId

public AdData.Builder setAdRenderId (String adRenderId)

Sets the ad render id for server auction

See AdData.getAdRenderId() for more information.

Parameters
adRenderId String: This value may be null.

Returns
AdData.Builder This value cannot be null.

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.

setRenderUri

public AdData.Builder setRenderUri (Uri renderUri)

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

See AdData.getRenderUri() for detail.

Parameters
renderUri Uri: This value cannot be null.

Returns
AdData.Builder This value cannot be null.