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 milliseconds, 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 setAuctionServerRequestFlags(int auctionServerRequestFlags)

Sets the bitfield of auction server request flags.

CustomAudience.Builder setBiddingLogicUri(Uri biddingLogicUri)

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

CustomAudience.Builder setBuyer(AdTechIdentifier buyer)

Sets the buyer AdTechIdentifier.

CustomAudience.Builder setDailyUpdateUri(Uri dailyUpdateUri)

Sets the daily update URI.

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 setTrustedBiddingData(TrustedBiddingData trustedBiddingData)

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

CustomAudience.Builder setUserBiddingSignals(AdSelectionSignals 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 milliseconds, after which the CustomAudience will serve ads.

Set to null in order for this CustomAudience to be immediately active and participate in ad selection.

See CustomAudience.getActivationTime() for more information.

Parameters
activationTime Instant: This value may be null.

Returns
CustomAudience.Builder

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.

setAuctionServerRequestFlags

public CustomAudience.Builder setAuctionServerRequestFlags (int auctionServerRequestFlags)

Sets the bitfield of auction server request flags.

See CustomAudience.getAuctionServerRequestFlags() for more information.

Parameters
auctionServerRequestFlags int: Value is either 0 or a combination of android.adservices.customaudience.CustomAudience.FLAG_AUCTION_SERVER_REQUEST_DEFAULT, and CustomAudience.FLAG_AUCTION_SERVER_REQUEST_OMIT_ADS

Returns
CustomAudience.Builder This value cannot be null.

setBiddingLogicUri

public CustomAudience.Builder setBiddingLogicUri (Uri biddingLogicUri)

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

See CustomAudience.getBiddingLogicUri() for more information.

Parameters
biddingLogicUri Uri: This value cannot be null.

Returns
CustomAudience.Builder This value cannot be null.

setBuyer

public CustomAudience.Builder setBuyer (AdTechIdentifier buyer)

Sets the buyer AdTechIdentifier.

See CustomAudience.getBuyer() for more information.

Parameters
buyer AdTechIdentifier: This value cannot be null.

Returns
CustomAudience.Builder This value cannot be null.

setDailyUpdateUri

public CustomAudience.Builder setDailyUpdateUri (Uri dailyUpdateUri)

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

See CustomAudience.getDailyUpdateUri() for more information.

Parameters
dailyUpdateUri 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.

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 (AdSelectionSignals userBiddingSignals)

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

See CustomAudience.getUserBiddingSignals() for more information.

Parameters
userBiddingSignals AdSelectionSignals: This value may be null.

Returns
CustomAudience.Builder This value cannot be null.