CustomAudience.Builder

public static final class CustomAudience.Builder
extends Object

java.lang.Object
   ↳ android.adservices.customaudience.CustomAudience.Builder


Builder for CustomAudience objects.

Summary

Public constructors

Builder()

Public methods

CustomAudience build()

Builds an instance of a CustomAudience.

CustomAudience.Builder setActivationTime(Instant activationTime)

Sets the time, truncated to seconds, after which the CustomAudience will serve ads.

CustomAudience.Builder setAds(List<AdData> ads)

Sets the initial remarketing ads served by the custom audience.

CustomAudience.Builder setBiddingLogicUrl(Uri biddingLogicUrl)

Sets the URL to fetch bidding logic from for use in the ad selection process.

CustomAudience.Builder setBuyer(String buyer)

Sets the buyer domain URL.

CustomAudience.Builder setDailyUpdateUrl(Uri dailyUpdateUrl)

Sets the daily update URL.

CustomAudience.Builder setExpirationTime(Instant expirationTime)

Sets the time, truncated to milliseconds, after which the CustomAudience should be removed.

CustomAudience.Builder setName(String name)

Sets the CustomAudience object's name.

CustomAudience.Builder setOwner(String owner)

Sets the owner application.

CustomAudience.Builder setTrustedBiddingData(TrustedBiddingData trustedBiddingData)

Sets the trusted bidding data to be queried and used in the ad selection process.

CustomAudience.Builder setUserBiddingSignals(String userBiddingSignals)

Sets the user bidding signals used in the ad selection process.

Inherited methods

Public constructors

Builder

public Builder ()

Public methods

build

public CustomAudience build ()

Builds an instance of a CustomAudience.

Returns
CustomAudience This value cannot be null.

Throws
NullPointerException if any non-null parameter is null
IllegalArgumentException if the expiration time occurs before activation time
IllegalArgumentException if the expiration time is set before the current time

setActivationTime

public CustomAudience.Builder setActivationTime (Instant activationTime)

Sets the time, truncated to seconds, after which the CustomAudience will serve ads.

See CustomAudience.getActivationTime() for more information.

Parameters
activationTime Instant: This value may be null.

Returns
CustomAudience.Builder This value cannot be null.

setAds

public CustomAudience.Builder setAds (List<AdData> ads)

Sets the initial remarketing ads served by the custom audience. Will be assigned with an empty list if not provided.

See CustomAudience.getAds() for more information.

Parameters
ads List: This value may be null.

Returns
CustomAudience.Builder This value cannot be null.

setBiddingLogicUrl

public CustomAudience.Builder setBiddingLogicUrl (Uri biddingLogicUrl)

Sets the URL to fetch bidding logic from for use in the ad selection process. The URL must use HTTPS.

See CustomAudience.getBiddingLogicUrl() ()} for more information.

Parameters
biddingLogicUrl Uri: This value cannot be null.

Returns
CustomAudience.Builder This value cannot be null.

setBuyer

public CustomAudience.Builder setBuyer (String buyer)

Sets the buyer domain URL.

See CustomAudience.getBuyer() for more information.

Parameters
buyer String: This value cannot be null.

Returns
CustomAudience.Builder This value cannot be null.

setDailyUpdateUrl

public CustomAudience.Builder setDailyUpdateUrl (Uri dailyUpdateUrl)

Sets the daily update URL. The URL must use HTTPS.

See CustomAudience.getDailyUpdateUrl() for more information.

Parameters
dailyUpdateUrl Uri: This value cannot be null.

Returns
CustomAudience.Builder This value cannot be null.

setExpirationTime

public CustomAudience.Builder setExpirationTime (Instant expirationTime)

Sets the time, truncated to milliseconds, after which the CustomAudience should be removed.

See CustomAudience.getExpirationTime() for more information.

Parameters
expirationTime Instant: This value may be null.

Returns
CustomAudience.Builder This value cannot be null.

setName

public CustomAudience.Builder setName (String name)

Sets the CustomAudience object's name.

See CustomAudience.getName() for more information.

Parameters
name String: This value cannot be null.

Returns
CustomAudience.Builder This value cannot be null.

setOwner

public CustomAudience.Builder setOwner (String owner)

Sets the owner application.

See CustomAudience.getOwner() for more information.

Parameters
owner String: <App UID>-<package name> or leave null to default to the calling app.

Returns
CustomAudience.Builder This value cannot be null.

setTrustedBiddingData

public CustomAudience.Builder setTrustedBiddingData (TrustedBiddingData trustedBiddingData)

Sets the trusted bidding data to be queried and used in the ad selection process.

See CustomAudience.getTrustedBiddingData() for more information.

Parameters
trustedBiddingData TrustedBiddingData: This value may be null.

Returns
CustomAudience.Builder This value cannot be null.

setUserBiddingSignals

public CustomAudience.Builder setUserBiddingSignals (String userBiddingSignals)

Sets the user bidding signals used in the ad selection process.

See CustomAudience.getUserBiddingSignals() for more information.

Parameters
userBiddingSignals String: This value may be null.

Returns
CustomAudience.Builder This value cannot be null.