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 Uri

Returns the renderUri that the AdSelection returns.

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.

getRenderUri

open fun getRenderUri(): Uri

Returns the renderUri that the AdSelection returns.

Return
Uri 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.