public static class TranslatorOptions.Builder extends Object
Builder to create a TranslatorOptions
instance.
Public Constructor Summary
Builder()
|
Public Method Summary
TranslatorOptions |
build()
Creates a new
TranslatorOptions
instance.
|
TranslatorOptions.Builder | |
TranslatorOptions.Builder | |
TranslatorOptions.Builder |
Inherited Method Summary
Public Constructors
public Builder ()
Public Methods
public TranslatorOptions build ()
Creates a new TranslatorOptions
instance. The source and target language should be set before calling this method.
public TranslatorOptions.Builder setExecutor (Executor executor)
public TranslatorOptions.Builder setSourceLanguage (String sourceLanguage)
Sets the language to translate from.
Parameters
sourceLanguage |
the BCP 47 tag of the language to
translate from. The value must be one of the possible values for
TranslateLanguage.Language ).
|
---|
Returns
- this object, for chaining method calls
public TranslatorOptions.Builder setTargetLanguage (String targetLanguage)
Sets the language to translate to.
Parameters
targetLanguage |
the BCP 47 tag of the language to
translate to. The value must be one of the possible values for
TranslateLanguage.Language ).
|
---|
Returns
- this object, for chaining method calls