AdSelectionOutcome


open class AdSelectionOutcome
kotlin.Any
   ↳ android.adservices.adselection.AdSelectionOutcome

This class represents a field in the OutcomeReceiver, which is an input to the android.adservices.adselection.AdSelectionManager#selectAds in the AdSelectionManager. This field is populated in the case of a successful android.adservices.adselection.AdSelectionManager#selectAds call.

Empty outcome may be returned from android.adservices.adselection.AdSelectionManager#selectAds(android.adservices.adselection.AdSelectionFromOutcomesConfig,java.util.concurrent.Executor,android.os.OutcomeReceiver). Use AdSelectionOutcome.hasOutcome() to check if an instance has a valid outcome. When android.adservices.adselection.AdSelectionOutcome#hasOutcome() returns false, results from getAdSelectionId() and AdSelectionOutcome.getRenderUri() are invalid and shouldn't be used.

Summary

Nested classes

Builder for AdSelectionOutcome objects.

Public methods
open Boolean
equals(other: Any?)

open Long

Returns the adSelectionId that identifies the AdSelection.

open MutableList<Uri!>

Returns the ad component renderUris that are returned by this auction.

open Uri

Returns the renderUri that the AdSelection returns.

open AdTechIdentifier

Returns the willing seller that won the auction.

open Boolean

Returns whether the outcome contains results or empty.

open Int

Properties
static AdSelectionOutcome

Represents an AdSelectionOutcome with empty results.

Public methods

equals

Added in API level 34
open fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getAdSelectionId

open fun getAdSelectionId(): Long

Returns the adSelectionId that identifies the AdSelection.

Return
Long This value cannot be null.

getComponentAdUris

open fun getComponentAdUris(): MutableList<Uri!>

Returns the ad component renderUris that are returned by this auction.

These URIs represent individual components of a multi-part ad creative. Seller ad tech SDKs are expected to fetch and render these components in their ad display logic.

This approach allows for flexible and dynamic ad creatives where different parts of the ad can be loaded and rendered independently.

Return
MutableList<Uri!> This value cannot be null.

getRenderUri

open fun getRenderUri(): Uri

Returns the renderUri that the AdSelection returns.

Return
Uri This value cannot be null.

getWinningSeller

open fun getWinningSeller(): AdTechIdentifier

Returns the willing seller that won the auction.

Return
AdTechIdentifier This value cannot be null.

hasOutcome

open fun hasOutcome(): Boolean

Returns whether the outcome contains results or empty. Empty outcomes' render uris shouldn't be used.

hashCode

Added in API level 34
open fun hashCode(): Int
Return
Int a hash code value for this object.

Properties

NO_OUTCOME

static val NO_OUTCOME: AdSelectionOutcome

Represents an AdSelectionOutcome with empty results.