LanguageScript Class

  • java.lang.Object
    • com.azure.ai.translation.text.models.LanguageScript

Implements

public class LanguageScript
implements JsonSerializable<LanguageScript>

Common properties of language script.

Constructor Summary

Modifier Constructor Description
protected LanguageScript(String code, String name, String nativeName, LanguageDirectionality directionality)

Creates an instance of LanguageScript class.

Method Summary

Modifier and Type Method and Description
static LanguageScript fromJson(JsonReader jsonReader)

Reads an instance of LanguageScript from the JsonReader.

String getCode()

Get the code property: Code identifying the script.

LanguageDirectionality getDirectionality()

Get the directionality property: Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages.

String getName()

Get the name property: Display name of the script in the locale requested via Accept-Language header.

String getNativeName()

Get the nativeName property: Display name of the language in the locale native for the language.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

LanguageScript

protected LanguageScript(String code, String name, String nativeName, LanguageDirectionality directionality)

Creates an instance of LanguageScript class.

Parameters:

code - the code value to set.
name - the name value to set.
nativeName - the nativeName value to set.
directionality - the directionality value to set.

Method Details

fromJson

public static LanguageScript fromJson(JsonReader jsonReader)

Reads an instance of LanguageScript from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of LanguageScript if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getCode

public String getCode()

Get the code property: Code identifying the script.

Returns:

the code value.

getDirectionality

public LanguageDirectionality getDirectionality()

Get the directionality property: Directionality, which is rtl for right-to-left languages or ltr for left-to-right languages.

Returns:

the directionality value.

getName

public String getName()

Get the name property: Display name of the script in the locale requested via Accept-Language header.

Returns:

the name value.

getNativeName

public String getNativeName()

Get the nativeName property: Display name of the language in the locale native for the language.

Returns:

the nativeName value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to