Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
A builder for ViewTranslationResponse
Summary
Public constructors |
Creates a new Builder.
|
Public constructors
Builder
Builder(autofillId: AutofillId)
Creates a new Builder.
Parameters |
autofillId |
AutofillId: The AutofillId of the view associated with this response. This value cannot be null . |
Public methods
build
fun build(): ViewTranslationResponse
Builds the instance. This builder should not be touched after calling this!
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,["# ViewTranslationResponse.Builder\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/translation/ViewTranslationResponse.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.view.translation.ViewTranslationResponse.Builder](#) |\n\nA builder for [ViewTranslationResponse](/reference/kotlin/android/view/translation/ViewTranslationResponse)\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder(android.view.autofill.AutofillId))`(`autofillId:` `[AutofillId](../autofill/AutofillId.html#)`)` Creates a new Builder. |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ViewTranslationResponse](/reference/kotlin/android/view/translation/ViewTranslationResponse) | [build](#build())`()` Builds the instance. |\n| [ViewTranslationResponse.Builder](#)! | [setValue](#setValue(kotlin.String,%20android.view.translation.TranslationResponseValue))`(`key:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[TranslationResponseValue](/reference/kotlin/android/view/translation/TranslationResponseValue)!`)` Sets the corresponding [TranslationResponseValue](/reference/kotlin/android/view/translation/TranslationResponseValue) for the provided key. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(autofillId: AutofillId)\n```\n\nCreates a new Builder.\n\n| Parameters ||\n|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `autofillId` | [AutofillId](../autofill/AutofillId.html#): The [AutofillId](../autofill/AutofillId.html#) of the view associated with this response. This value cannot be `null`. |\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): ViewTranslationResponse\n```\n\nBuilds the instance. This builder should not be touched after calling this!\n\n| Return ||\n|-----------------------------------------------------------------------------------------------|------------------------------|\n| [ViewTranslationResponse](/reference/kotlin/android/view/translation/ViewTranslationResponse) | This value cannot be `null`. |\n\n### setValue\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setValue(\n key: String!, \n value: TranslationResponseValue!\n): ViewTranslationResponse.Builder!\n```\n\nSets the corresponding [TranslationResponseValue](/reference/kotlin/android/view/translation/TranslationResponseValue) for the provided key.\n\n| Parameters ||\n|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `key` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: The key for this translation response value. |\n| `value` | [TranslationResponseValue](/reference/kotlin/android/view/translation/TranslationResponseValue)!: the translation response value holding the translated content. |\n\n| Return ||\n|---------------------------------------|---------------|\n| [ViewTranslationResponse.Builder](#)! | this builder. |"]]