Added in API level 31

Builder


class Builder
kotlin.Any
   ↳ android.view.translation.TranslationResponseValue.Builder

A builder for TranslationResponseValue

Summary

Public constructors
Builder(statusCode: Int)

Creates a new Builder.

Public methods
TranslationResponseValue

Builds the instance.

TranslationResponseValue.Builder
setExtras(value: Bundle)

Extra results associated with the translated text.

TranslationResponseValue.Builder

The translated text result.

TranslationResponseValue.Builder

The transliteration result of the translated text.

Public constructors

Builder

Added in API level 31
Builder(statusCode: Int)

Creates a new Builder.

Parameters
statusCode Int: The status code of this TranslationResponseValue.

If the status code is STATUS_ERROR, no values are attached, and all getters will return null. Value is android.view.translation.TranslationResponseValue#STATUS_SUCCESS, or android.view.translation.TranslationResponseValue#STATUS_ERROR

Public methods

build

Added in API level 31
fun build(): TranslationResponseValue

Builds the instance. This builder should not be touched after calling this!

Return
TranslationResponseValue This value cannot be null.

setExtras

Added in API level 31
fun setExtras(value: Bundle): TranslationResponseValue.Builder

Extra results associated with the translated text.

The bundle includes EXTRA_DEFINITIONS, obtained by Bundle#getBundle.

Parameters
value Bundle: This value cannot be null.
Return
TranslationResponseValue.Builder This value cannot be null.

setText

Added in API level 31
fun setText(value: CharSequence): TranslationResponseValue.Builder

The translated text result.

Parameters
value CharSequence: This value cannot be null.
Return
TranslationResponseValue.Builder This value cannot be null.

setTransliteration

Added in API level 31
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.

Parameters
value CharSequence: This value cannot be null.
Return
TranslationResponseValue.Builder This value cannot be null.