Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder for AdSelectionOutcome
objects.
Summary
Public constructors
Public methods
build
fun build(): AdSelectionOutcome
Builds a AdSelectionOutcome
instance.
Exceptions |
java.lang.IllegalArgumentException |
if the adSelectionIid is not set |
java.lang.NullPointerException |
if the RenderUri is null |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-03-13 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-13 UTC."],[],[],null,["# AdSelectionOutcome.Builder\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/adservices/adselection/AdSelectionOutcome.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|----------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.adservices.adselection.AdSelectionOutcome.Builder](#) |\n\nBuilder for [AdSelectionOutcome](/reference/kotlin/android/adservices/adselection/AdSelectionOutcome) objects.\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------|---|\n| [Builder](#Builder())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [AdSelectionOutcome](/reference/kotlin/android/adservices/adselection/AdSelectionOutcome) | [build](#build())`()` Builds a [AdSelectionOutcome](/reference/kotlin/android/adservices/adselection/AdSelectionOutcome) instance. |\n| [AdSelectionOutcome.Builder](#) | [setAdSelectionId](#setAdSelectionId(kotlin.Long))`(`adSelectionId:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Sets the mAdSelectionId. |\n| [AdSelectionOutcome.Builder](#) | [setComponentAdUris](#setComponentAdUris(kotlin.collections.MutableList))`(`componentAdUris:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\u003c[Uri](../../net/Uri.html#)!\u003e`)` Sets the list of ad component renderUris. |\n| [AdSelectionOutcome.Builder](#) | [setRenderUri](#setRenderUri(android.net.Uri))`(`renderUri:` `[Uri](../../net/Uri.html#)`)` Sets the RenderUri. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions) \n\n```\nBuilder()\n```\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions) \n\n```\nfun build(): AdSelectionOutcome\n```\n\nBuilds a [AdSelectionOutcome](/reference/kotlin/android/adservices/adselection/AdSelectionOutcome) instance.\n\n| Return ||\n|-------------------------------------------------------------------------------------------|------------------------------|\n| [AdSelectionOutcome](/reference/kotlin/android/adservices/adselection/AdSelectionOutcome) | This value cannot be `null`. |\n\n| Exceptions ||\n|--------------------------------------|----------------------------------|\n| `java.lang.IllegalArgumentException` | if the adSelectionIid is not set |\n| `java.lang.NullPointerException` | if the RenderUri is null |\n\n### setAdSelectionId\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions) \n\n```\nfun setAdSelectionId(adSelectionId: Long): AdSelectionOutcome.Builder\n```\n\nSets the mAdSelectionId.\n\n| Return ||\n|---------------------------------|------------------------------|\n| [AdSelectionOutcome.Builder](#) | This value cannot be `null`. |\n\n### setComponentAdUris\n\nAdded in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 16](https://developer.android.com/sdkExtensions) \n\n```\nfun setComponentAdUris(componentAdUris: MutableList\u003cUri!\u003e): AdSelectionOutcome.Builder\n```\n\nSets the list of ad component renderUris.\n\n| Parameters ||\n|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `componentAdUris` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\\\u003c[Uri](../../net/Uri.html#)!\\\u003e: This value cannot be `null`. |\n\n| Return ||\n|---------------------------------|------------------------------|\n| [AdSelectionOutcome.Builder](#) | This value cannot be `null`. |\n\n### setRenderUri\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions) \n\n```\nfun setRenderUri(renderUri: Uri): AdSelectionOutcome.Builder\n```\n\nSets the RenderUri.\n\n| Parameters ||\n|-------------|----------------------------------------------------------|\n| `renderUri` | [Uri](../../net/Uri.html#): This value cannot be `null`. |\n\n| Return ||\n|---------------------------------|------------------------------|\n| [AdSelectionOutcome.Builder](#) | This value cannot be `null`. |"]]