Modifier and Type | Method and Description |
---|---|
static java.util.Optional<Language> |
of(java.util.Locale locale)
Returns an
Optional that contains the Language for the given Locale
or an empty Optional if there is no Language associated with the language
obtained from the given Locale . |
static java.util.Optional<Language> |
of(java.lang.String language,
java.lang.String country)
Returns an
Optional that contains the Language for the given language
and country codes or an empty Optional if there is no Language
associated with the specified language and country codes. |
java.lang.String |
toString()
Returns a string representation of the current language in format:
|
static Language |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Language[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Language AMHARIC
public static final Language ARABIC
public static final Language BULGARIAN
public static final Language BENGALI
public static final Language CATALAN
public static final Language CZECH
public static final Language DANISH
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_LATIN_AMERICA
public static final Language SPANISH_SPAIN
public static final Language ESTONIAN
public static final Language PERSIAN
public static final Language FINNISH
public static final Language FILIPINO
public static final Language FRENCH
public static final Language GUJARATI
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 JAPANESE
public static final Language KANNADA
public static final Language KOREAN
public static final Language LITHUANIAN
public static final Language LATVIAN
public static final Language MALAYALAM
public static final Language MARATHI
public static final Language MALAY
public static final Language NORWEGIAN
public static final Language DUTCH
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 SWAHILI
public static final Language TAMIL
public static final Language TELUGU
public static final Language THAI
public static final Language TURKISH
public static final Language UKRAINIAN
public static final Language VIETNAMESE
public static final Language CHINESE
public static final Language CHINESE_TAIWAN
public static Language[] values()
for (Language c : Language.values()) System.out.println(c);
public static Language valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static java.util.Optional<Language> of(java.util.Locale locale)
Optional
that contains the Language
for the given Locale
or an empty Optional
if there is no Language
associated with the language
obtained from the given Locale
.public static java.util.Optional<Language> of(java.lang.String language, java.lang.String country)
Optional
that contains the Language
for the given language
and country
codes or an empty Optional
if there is no Language
associated with the specified language
and country
codes.
Use instead of of(Locale)
if there is a need to pass the new language
codes instead of the old ones, because Locale
internally converts the new language
code passed to the constructor to the old one. There is a chance not to find a language for
an old code, so if you want to be sure that the passed locale will not be converted, use this
method with the required language and country codes.
A set of the new language codes that will be converted to the old ones in the Locale
are specified in Locale.Locale(String)
.
public java.lang.String toString()
<language code>SEPARATOR<country code>
where SEPARATOR
is a platform dependent symbol (either "_" or "-").toString
in class java.lang.Enum<Language>