Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
A builder for TranslationResponseValue
Summary
Public constructors |
Creates a new Builder.
|
Public constructors
Builder
Builder(statusCode: Int)
Creates a new Builder.
Public methods
setTransliteration
fun setTransliteration(value: CharSequence): TranslationResponseValue.Builder
The transliteration result of the translated text.
This returns a CharSequence representation of the transliteration of the translated text.
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,["# TranslationResponseValue.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/TranslationResponseValue.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.TranslationResponseValue.Builder](#) |\n\nA builder for [TranslationResponseValue](/reference/kotlin/android/view/translation/TranslationResponseValue)\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder(kotlin.Int))`(`statusCode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Creates a new Builder. |\n\n| Public methods ||\n|-------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [TranslationResponseValue](/reference/kotlin/android/view/translation/TranslationResponseValue) | [build](#build())`()` Builds the instance. |\n| [TranslationResponseValue.Builder](#) | [setExtras](#setExtras(android.os.Bundle))`(`value:` `[Bundle](../../os/Bundle.html#)`)` Extra results associated with the translated text. |\n| [TranslationResponseValue.Builder](#) | [setText](#setText(kotlin.CharSequence))`(`value:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)`)` The translated text result. |\n| [TranslationResponseValue.Builder](#) | [setTransliteration](#setTransliteration(kotlin.CharSequence))`(`value:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)`)` The transliteration result of the translated text. |\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(statusCode: Int)\n```\n\nCreates a new Builder.\n\n| Parameters ||\n|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `statusCode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The status code of this [TranslationResponseValue](/reference/kotlin/android/view/translation/TranslationResponseValue). If the status code is [STATUS_ERROR](/reference/kotlin/android/view/translation/TranslationResponseValue#STATUS_ERROR:kotlin.Int), no values are attached, and all getters will return `null`. Value is [android.view.translation.TranslationResponseValue#STATUS_SUCCESS](/reference/kotlin/android/view/translation/TranslationResponseValue#STATUS_SUCCESS:kotlin.Int), or [android.view.translation.TranslationResponseValue#STATUS_ERROR](/reference/kotlin/android/view/translation/TranslationResponseValue#STATUS_ERROR:kotlin.Int) |\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(): TranslationResponseValue\n```\n\nBuilds the instance. This builder should not be touched after calling this!\n\n| Return ||\n|-------------------------------------------------------------------------------------------------|------------------------------|\n| [TranslationResponseValue](/reference/kotlin/android/view/translation/TranslationResponseValue) | This value cannot be `null`. |\n\n### setExtras\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setExtras(value: Bundle): TranslationResponseValue.Builder\n```\n\nExtra results associated with the translated text.\n\nThe bundle includes [EXTRA_DEFINITIONS](/reference/kotlin/android/view/translation/TranslationResponseValue#EXTRA_DEFINITIONS:kotlin.String), obtained by [Bundle.getBundle](../../os/Bundle.html#getBundle(kotlin.String)).\n\n| Parameters ||\n|---------|---------------------------------------------------------------|\n| `value` | [Bundle](../../os/Bundle.html#): This value cannot be `null`. |\n\n| Return ||\n|---------------------------------------|------------------------------|\n| [TranslationResponseValue.Builder](#) | This value cannot be `null`. |\n\n### setText\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setText(value: CharSequence): TranslationResponseValue.Builder\n```\n\nThe translated text result.\n\n| Parameters ||\n|---------|-----------------------------------------------------------------------------------------------------------------------------|\n| `value` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html): This value cannot be `null`. |\n\n| Return ||\n|---------------------------------------|------------------------------|\n| [TranslationResponseValue.Builder](#) | This value cannot be `null`. |\n\n### setTransliteration\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setTransliteration(value: CharSequence): TranslationResponseValue.Builder\n```\n\nThe transliteration result of the translated text.\n\nThis returns a CharSequence representation of the transliteration of the translated text.\n\n| Parameters ||\n|---------|-----------------------------------------------------------------------------------------------------------------------------|\n| `value` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html): This value cannot be `null`. |\n\n| Return ||\n|---------------------------------------|------------------------------|\n| [TranslationResponseValue.Builder](#) | This value cannot be `null`. |"]]