TranslationResponseValue.Builder
public
static
final
class
TranslationResponseValue.Builder
extends Object
java.lang.Object | |
↳ | android.view.translation.TranslationResponseValue.Builder |
A builder for TranslationResponseValue
Summary
Public constructors | |
---|---|
Builder(int statusCode)
Creates a new Builder. |
Public methods | |
---|---|
TranslationResponseValue
|
build()
Builds the instance. |
TranslationResponseValue.Builder
|
setExtras(Bundle value)
Extra results associated with the translated text. |
TranslationResponseValue.Builder
|
setText(CharSequence value)
The translated text result. |
TranslationResponseValue.Builder
|
setTransliteration(CharSequence value)
The transliteration result of the translated text. |
Inherited methods | |
---|---|
Public constructors
Builder
public Builder (int statusCode)
Creates a new Builder.
Parameters | |
---|---|
statusCode |
int : The status code of this TranslationResponseValue .
If the status code is |
Public methods
build
public TranslationResponseValue build ()
Builds the instance. This builder should not be touched after calling this!
Returns | |
---|---|
TranslationResponseValue |
This value cannot be null . |
setExtras
public TranslationResponseValue.Builder setExtras (Bundle value)
Extra results associated with the translated text.
The bundle includes TranslationResponseValue.EXTRA_DEFINITIONS
, obtained by Bundle#getBundle
.
Parameters | |
---|---|
value |
Bundle : This value cannot be null . |
Returns | |
---|---|
TranslationResponseValue.Builder |
This value cannot be null . |
setText
public TranslationResponseValue.Builder setText (CharSequence value)
The translated text result.
Parameters | |
---|---|
value |
CharSequence : This value cannot be null . |
Returns | |
---|---|
TranslationResponseValue.Builder |
This value cannot be null . |
setTransliteration
public TranslationResponseValue.Builder setTransliteration (CharSequence value)
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 . |
Returns | |
---|---|
TranslationResponseValue.Builder |
This value cannot be null . |