Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder for PersistAdSelectionResultRequest
objects.
Summary
Public constructors
Public methods
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-08-20 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-08-20 UTC."],[],[],null,["# PersistAdSelectionResultRequest.Builder\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 10](https://developer.android.com/sdkExtensions)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/adservices/adselection/PersistAdSelectionResultRequest.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.PersistAdSelectionResultRequest.Builder](#) |\n\nBuilder for [PersistAdSelectionResultRequest](/reference/kotlin/android/adservices/adselection/PersistAdSelectionResultRequest) objects.\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------|---|\n| [Builder](#Builder())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|---------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [PersistAdSelectionResultRequest](/reference/kotlin/android/adservices/adselection/PersistAdSelectionResultRequest) | [build](#build())`()` Builds a [PersistAdSelectionResultRequest](/reference/kotlin/android/adservices/adselection/PersistAdSelectionResultRequest) instance. |\n| [PersistAdSelectionResultRequest.Builder](#) | [setAdSelectionDataId](#setAdSelectionDataId(kotlin.Long))`(`adSelectionDataId:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Sets the ad selection data id [Long](../../../java/lang/Long.html#). |\n| [PersistAdSelectionResultRequest.Builder](#) | [setAdSelectionId](#setAdSelectionId(kotlin.Long))`(`adSelectionId:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Sets the ad selection id [Long](../../../java/lang/Long.html#). |\n| [PersistAdSelectionResultRequest.Builder](#) | [setAdSelectionResult](#setAdSelectionResult(kotlin.ByteArray))`(`adSelectionResult:` `[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)?`)` Sets the ad selection result [String](../../../java/lang/String.html#). |\n| [PersistAdSelectionResultRequest.Builder](#) | [setSeller](#setSeller(android.adservices.common.AdTechIdentifier))`(`seller:` `[AdTechIdentifier](../common/AdTechIdentifier.html#)?`)` Sets the seller [AdTechIdentifier](../common/AdTechIdentifier.html#). |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 10](https://developer.android.com/sdkExtensions) \n\n```\nBuilder()\n```\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 10](https://developer.android.com/sdkExtensions) \n\n```\nfun build(): PersistAdSelectionResultRequest\n```\n\nBuilds a [PersistAdSelectionResultRequest](/reference/kotlin/android/adservices/adselection/PersistAdSelectionResultRequest) instance.\n\n| Return ||\n|---------------------------------------------------------------------------------------------------------------------|------------------------------|\n| [PersistAdSelectionResultRequest](/reference/kotlin/android/adservices/adselection/PersistAdSelectionResultRequest) | This value cannot be `null`. |\n\n| Exceptions ||\n|--------------------------------------|----------------------------------|\n| `java.lang.IllegalArgumentException` | if the adSelectionIid is not set |\n\n### setAdSelectionDataId\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 12](https://developer.android.com/sdkExtensions) \n\n```\nfun setAdSelectionDataId(adSelectionDataId: Long): PersistAdSelectionResultRequest.Builder\n```\n\nSets the ad selection data id [Long](../../../java/lang/Long.html#).\n\n| Return ||\n|----------------------------------------------|------------------------------|\n| [PersistAdSelectionResultRequest.Builder](#) | This value cannot be `null`. |\n\n### setAdSelectionId\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 10](https://developer.android.com/sdkExtensions) \nDeprecated in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setAdSelectionId(adSelectionId: Long): PersistAdSelectionResultRequest.Builder\n```\n\n**Deprecated:** *Use the [setAdSelectionDataId(long)](#setAdSelectionDataId(kotlin.Long)) instead.*\n\nSets the ad selection id [Long](../../../java/lang/Long.html#).\n\n| Return ||\n|----------------------------------------------|------------------------------|\n| [PersistAdSelectionResultRequest.Builder](#) | This value cannot be `null`. |\n\n### setAdSelectionResult\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 10](https://developer.android.com/sdkExtensions) \n\n```\nfun setAdSelectionResult(adSelectionResult: ByteArray?): PersistAdSelectionResultRequest.Builder\n```\n\nSets the ad selection result [String](../../../java/lang/String.html#).\n\n| Parameters ||\n|---------------------|---------------------------------------------------------------------------------------------------------------------|\n| `adSelectionResult` | [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)?: This value may be `null`. |\n\n| Return ||\n|----------------------------------------------|------------------------------|\n| [PersistAdSelectionResultRequest.Builder](#) | This value cannot be `null`. |\n\n### setSeller\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 10](https://developer.android.com/sdkExtensions) \n\n```\nfun setSeller(seller: AdTechIdentifier?): PersistAdSelectionResultRequest.Builder\n```\n\nSets the seller [AdTechIdentifier](../common/AdTechIdentifier.html#).\n\n| Parameters ||\n|----------|----------------------------------------------------------------------------------|\n| `seller` | [AdTechIdentifier](../common/AdTechIdentifier.html#)?: This value may be `null`. |\n\n| Return ||\n|----------------------------------------------|------------------------------|\n| [PersistAdSelectionResultRequest.Builder](#) | This value cannot be `null`. |"]]