public final class Language
extends java.lang.Object
This class contains a pre-defined set of languages supported by Chromium, and also allows you to create a new one from the language abbreviation pair.
Modifier and Type | Field and Description |
---|---|
static Language |
BULGARIAN |
static Language |
CATALAN |
static Language |
CROATIAN |
static Language |
CZECH |
static Language |
DANISH |
static Language |
DUTCH |
static Language |
ENGLISH_UK |
static Language |
ENGLISH_US |
static Language |
ESTONIAN |
static Language |
FRENCH |
static Language |
GERMAN |
static Language |
GREEK |
static Language |
HEBREW |
static Language |
HINDI |
static Language |
HUNGARIAN |
static Language |
INDONESIAN |
static Language |
ITALIAN |
static Language |
KOREAN |
static Language |
LATVIAN |
static Language |
LITHUANIAN |
static Language |
NORWEGIAN |
static Language |
PERSIAN |
static Language |
POLISH |
static Language |
PORTUGUESE_BRAZIL |
static Language |
PORTUGUESE_PORTUGAL |
static Language |
ROMANIAN |
static Language |
RUSSIAN |
static Language |
SERBIAN |
static Language |
SLOVAK |
static Language |
SLOVENIAN |
static Language |
SPANISH_SPAIN |
static Language |
SWEDISH |
static Language |
TURKISH |
static Language |
UKRAINIAN |
static Language |
VIETNAMESE |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
code()
Returns the language code.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
static Language |
of(java.lang.String code)
Returns a
Language with the given code . |
static Language |
of(java.lang.String code,
java.lang.String region)
Creates a new
Language with the given code and region . |
java.util.Optional<java.lang.String> |
region()
Returns an
Optional that contains a string that represents the region or an
empty Optional if the region is not specified. |
java.lang.String |
toString()
Returns a string representation of the
Language . |
public static final Language BULGARIAN
public static final Language CATALAN
public static final Language CZECH
public static final Language DANISH
public static final Language DUTCH
public static final Language GERMAN
public static final Language GREEK
public static final Language ENGLISH_US
public static final Language ENGLISH_UK
public static final Language SPANISH_SPAIN
public static final Language ESTONIAN
public static final Language PERSIAN
public static final Language FRENCH
public static final Language HEBREW
public static final Language HINDI
public static final Language CROATIAN
public static final Language HUNGARIAN
public static final Language INDONESIAN
public static final Language ITALIAN
public static final Language KOREAN
public static final Language LITHUANIAN
public static final Language LATVIAN
public static final Language NORWEGIAN
public static final Language POLISH
public static final Language PORTUGUESE_BRAZIL
public static final Language PORTUGUESE_PORTUGAL
public static final Language ROMANIAN
public static final Language RUSSIAN
public static final Language SLOVAK
public static final Language SLOVENIAN
public static final Language SERBIAN
public static final Language SWEDISH
public static final Language TURKISH
public static final Language UKRAINIAN
public static final Language VIETNAMESE
public static Language of(java.lang.String code, java.lang.String region)
Language
with the given code
and region
.
This method does not check that the constructed Language
is a valid language
that can be used for spell checking.
code
- the language coderegion
- the regionLanguage
with the given code
and region
.java.lang.IllegalArgumentException
- when the given code
or region
is empty or blankpublic static Language of(java.lang.String code)
Language
with the given code
.code
- the language codeLanguage
with the given code
public java.lang.String code()
public java.util.Optional<java.lang.String> region()
Optional
that contains a string that represents the region or an
empty Optional
if the region is not specified.public java.lang.String toString()
Language
.
This method returns a string equal to the value of
<code>-<region>
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object