Class Translation (2.3.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
NameDescription
objObject
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
String

getTranslatedText()

public String getTranslatedText()

Returns the translated text.

Returns
TypeDescription
String

hashCode()

public final int hashCode()
Returns
TypeDescription
int
Overrides

toString()

public String toString()
Returns
TypeDescription
String
Overrides