Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder for GetTopicsResponse
objects. This class should be used in test implementation as expected response from Topics API
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-02-10 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-02-10 UTC."],[],[],null,["# GetTopicsResponse.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/topics/GetTopicsResponse.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.topics.GetTopicsResponse.Builder](#) |\n\nBuilder for [GetTopicsResponse](/reference/kotlin/android/adservices/topics/GetTopicsResponse) objects. This class should be used in test implementation as expected response from Topics API\n\nSummary\n-------\n\n| Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder(kotlin.collections.MutableList))`(`topics:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\u003c[Topic](/reference/kotlin/android/adservices/topics/Topic)!\u003e`)` Creates a [Builder](#) for [GetTopicsResponse](/reference/kotlin/android/adservices/topics/GetTopicsResponse) objects. |\n| [Builder](#Builder(kotlin.collections.MutableList,%20kotlin.collections.MutableList))`(`topics:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\u003c[Topic](/reference/kotlin/android/adservices/topics/Topic)!\u003e`, `encryptedTopics:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\u003c[EncryptedTopic](/reference/kotlin/android/adservices/topics/EncryptedTopic)!\u003e`)` Creates a [Builder](#) for [GetTopicsResponse](/reference/kotlin/android/adservices/topics/GetTopicsResponse) objects. |\n\n| Public methods ||\n|------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|\n| [GetTopicsResponse](/reference/kotlin/android/adservices/topics/GetTopicsResponse) | [build](#build())`()` Builds a [GetTopicsResponse](/reference/kotlin/android/adservices/topics/GetTopicsResponse) instance. |\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 11](https://developer.android.com/sdkExtensions) \n\n```\nBuilder(topics: MutableList\u003cTopic!\u003e)\n```\n\n**Deprecated:** *This function is deprecated.*\n\nCreates a [Builder](#) for [GetTopicsResponse](/reference/kotlin/android/adservices/topics/GetTopicsResponse) objects.\n\n| Parameters ||\n|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `topics` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\\\u003c[Topic](/reference/kotlin/android/adservices/topics/Topic)!\\\u003e: The list of the returned Topics. This value cannot be `null`. |\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 11](https://developer.android.com/sdkExtensions) \n\n```\nBuilder(\n topics: MutableList\u003cTopic!\u003e, \n encryptedTopics: MutableList\u003cEncryptedTopic!\u003e)\n```\n\nCreates a [Builder](#) for [GetTopicsResponse](/reference/kotlin/android/adservices/topics/GetTopicsResponse) objects.\n\n| Parameters ||\n|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `topics` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\\\u003c[Topic](/reference/kotlin/android/adservices/topics/Topic)!\\\u003e: The list of the returned Topics. This value cannot be `null`. |\n| `encryptedTopics` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\\\u003c[EncryptedTopic](/reference/kotlin/android/adservices/topics/EncryptedTopic)!\\\u003e: The list of encrypted Topics. This value cannot be `null`. |\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(): GetTopicsResponse\n```\n\nBuilds a [GetTopicsResponse](/reference/kotlin/android/adservices/topics/GetTopicsResponse) instance.\n\n| Return ||\n|------------------------------------------------------------------------------------|------------------------------|\n| [GetTopicsResponse](/reference/kotlin/android/adservices/topics/GetTopicsResponse) | This value cannot be `null`. |\n\n| Exceptions ||\n|--------------------------------------|--------------------------------|\n| `java.lang.IllegalArgumentException` | if any of the params are null. |"]]