Class Translation (2.54.0)

public class Translation implements Serializable

Information about a translation. Objects of this class contain the translated text and the source language's code. The source language's code can be optionally specified by the user or automatically detected by the Google Translation service. See Also: Translating Text

Inheritance

Object > Translation

Implements

Serializable

Methods

equals(Object obj)

public final boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getModel()

public String getModel()

Returns the translation model used to translate the text. This value is only available if a result from Translate.TranslateOption#model(String) was passed to Translate#translate(List, Translate.TranslateOption...).

Please note that you must be whitelisted to use the Translate.TranslateOption#model(String) option, otherwise translation will fail.

Returns
Type Description
String

getSourceLanguage()

public String getSourceLanguage()

Returns the language code of the source text. If no source language was provided this value is the source language as detected by the Google Translation service.

Returns
Type Description
String

getTranslatedText()

public String getTranslatedText()

Returns the translated text.

Returns
Type Description
String

hashCode()

public final int hashCode()
Returns
Type Description
int
Overrides

toString()

public String toString()
Returns
Type Description
String
Overrides