Enum LocaleCode
- java.lang.Object
-
- java.lang.Enum<LocaleCode>
-
- com.neovisionaries.i18n.LocaleCode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<LocaleCode>
public enum LocaleCode extends java.lang.Enum<LocaleCode>
Locale code.The list of the enum entries was generated based on the output from
Locale.getAvailableLocales()
of Java SE 7, but locales whose format do not match either 'xx' or 'xx-XX' were excluded.// List all the locale codes. for (LocaleCode code : LocaleCode.values()) { String language = code.
getLanguage()
.getName()
; String country = code.getCountry()
!= null ? code.getCountry()
.getName()
: null; // For example, "[de-DE] German, Germany" is printed. System.out.format("[%s] %s, %s\n", code, language, country); } // Get a LocaleCode instance in various ways. LocaleCode code; code = LocaleCode.getByCode
("en-GB"); code = LocaleCode.getByCode
("es", "ES"); code = LocaleCode.getByLocale
(new Locale("pt", "BR")); // Convert to a Locale instance. Locale locale = LocaleCode.en
.toLocale()
; // toLocale() of some LocaleCode instances does not create // a new Locale instance but returns a static variable of // Locale class instead. SeetoLocale()
for details. if (locale == Locale.ENGLISH) { System.out.println("Locale.en.toLocale() returned Locale.ENGLISH"); } // Get a list of LocaleCode instances whose language is Arabic. List<LocaleCode> list = LocaleCode.getByLanguage
(LanguageCode.ar
); // Get a list of LocaleCode instances whose country is Switzerland. list = LocaleCode.getByCountry
(CountryCode.CH
);
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ar
ar_AE
ar_BH
ar_DZ
ar_EG
ar_IQ
ar_JO
ar_KW
ar_LB
ar_LY
ar_MA
ar_OM
ar_QA
ar_SA
ar_SD
ar_SY
ar_TN
ar_YE
be
be_BY
bg
bg_BG
ca
ca_ES
cs
cs_CZ
da
da_DK
de
de_AT
de_CH
de_DE
de_LU
el
el_CY
el_GR
en
en_AU
en_CA
en_GB
en_HK
en_IE
en_IN
en_MT
en_NZ
en_PH
en_SG
en_US
en_ZA
es
es_AR
es_BO
es_CL
es_CO
es_CR
es_DO
es_EC
es_ES
es_GT
es_HN
es_MX
es_NI
es_PA
es_PE
es_PR
es_PY
es_SV
es_US
es_UY
es_VE
et
et_EE
fa
fa_IR
fi
fi_FI
fr
fr_BE
fr_CA
fr_CH
fr_FR
fr_LU
ga
ga_IE
he
he_IL
hi_IN
hr
hr_HR
hu
hu_HU
id
id_ID
is
is_IS
it
it_CH
it_IT
ja
ja_JP
kk_KZ
ko
ko_KR
lt
lt_LT
lv
lv_LV
mk
mk_MK
ms
ms_MY
mt
mt_MT
nb
nb_NO
nl
nl_BE
nl_NL
nn_NO
no
no_NO
Deprecated.nb_NO
should be used.pl
pl_PL
pt
pt_BR
pt_PT
ro
ro_MD
ro_RO
ru
ru_KZ
ru_RU
se
se_NO
sk
sk_SK
sl
sl_SI
sq
sq_AL
sr
sr_BA
sr_CS
sr_ME
sr_RS
sv
sv_SE
th
th_TH
tr
tr_TR
uk
uk_UA
undefined
vi
vi_VN
zh
zh_CN
zh_HK
zh_SG
zh_TW
-
Field Summary
Fields Modifier and Type Field Description private CountryCode
country
private LanguageCode
language
private java.lang.String
string
private static java.util.Locale
undefinedLocale
-
Constructor Summary
Constructors Modifier Constructor Description private
LocaleCode(LanguageCode language, CountryCode country)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LocaleCode
getByCode(java.lang.String code)
Get aLocaleCode
instance that corresponds to the given code.static LocaleCode
getByCode(java.lang.String code, boolean caseSensitive)
Get aLocaleCode
instance that corresponds to the given code.static LocaleCode
getByCode(java.lang.String language, java.lang.String country)
Get aLocaleCode
instance that corresponds to the given pair of language code and country code.static LocaleCode
getByCode(java.lang.String language, java.lang.String country, boolean caseSensitive)
Get aLocaleCode
instance that corresponds to the given pair of language code and country code.static LocaleCode
getByCodeIgnoreCase(java.lang.String code)
Get aLocaleCode
instance that corresponds to the given code.static LocaleCode
getByCodeIgnoreCase(java.lang.String language, java.lang.String country)
Get aLocaleCode
instance that corresponds to the given pair of language code and country code.private static LocaleCode
getByCombinedCode(java.lang.String code, boolean caseSensitive, int splitPosition)
static java.util.List<LocaleCode>
getByCountry(CountryCode country)
Get a list ofLocaleCode
instances whose country matches the given one.static java.util.List<LocaleCode>
getByCountry(java.lang.String country)
Get a list ofLocaleCode
instances whose country matches the given one.static java.util.List<LocaleCode>
getByCountry(java.lang.String country, boolean caseSensitive)
Get a list ofLocaleCode
instances whose country matches the given one.static java.util.List<LocaleCode>
getByCountryIgnoreCase(java.lang.String country)
Get a list ofLocaleCode
instances whose country matches the given one.private static LocaleCode
getByEnumName(java.lang.String name)
static java.util.List<LocaleCode>
getByLanguage(LanguageCode language)
Get a list ofLocaleCode
instances whose language matches the given one.static java.util.List<LocaleCode>
getByLanguage(java.lang.String language)
Get a list ofLocaleCode
instances whose language matches the given one.static java.util.List<LocaleCode>
getByLanguage(java.lang.String language, boolean caseSensitive)
Get a list ofLocaleCode
instances whose language matches the given one.static java.util.List<LocaleCode>
getByLanguageIgnoreCase(java.lang.String language)
Get a list ofLocaleCode
instances whose language matches the given one.static LocaleCode
getByLocale(java.util.Locale locale)
Get aLocaleCode
instance that corresponds to the givenLocale
instance.CountryCode
getCountry()
Get the country code.LanguageCode
getLanguage()
Get the language code.private static java.util.Locale
getUndefinedLocale()
java.util.Locale
toLocale()
Convert thisLocaleCode
instance to aLocale
instance.java.lang.String
toString()
Get the string representation of this locale code.static LocaleCode
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static LocaleCode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
undefined
public static final LocaleCode undefined
- Since:
- 1.14
-
ar
public static final LocaleCode ar
-
ar_AE
public static final LocaleCode ar_AE
-
ar_BH
public static final LocaleCode ar_BH
-
ar_DZ
public static final LocaleCode ar_DZ
-
ar_EG
public static final LocaleCode ar_EG
-
ar_IQ
public static final LocaleCode ar_IQ
-
ar_JO
public static final LocaleCode ar_JO
-
ar_KW
public static final LocaleCode ar_KW
-
ar_LB
public static final LocaleCode ar_LB
-
ar_LY
public static final LocaleCode ar_LY
-
ar_MA
public static final LocaleCode ar_MA
-
ar_OM
public static final LocaleCode ar_OM
-
ar_QA
public static final LocaleCode ar_QA
-
ar_SA
public static final LocaleCode ar_SA
-
ar_SD
public static final LocaleCode ar_SD
-
ar_SY
public static final LocaleCode ar_SY
-
ar_TN
public static final LocaleCode ar_TN
-
ar_YE
public static final LocaleCode ar_YE
-
be
public static final LocaleCode be
-
be_BY
public static final LocaleCode be_BY
-
bg
public static final LocaleCode bg
-
bg_BG
public static final LocaleCode bg_BG
-
ca
public static final LocaleCode ca
-
ca_ES
public static final LocaleCode ca_ES
-
cs
public static final LocaleCode cs
-
cs_CZ
public static final LocaleCode cs_CZ
-
da
public static final LocaleCode da
-
da_DK
public static final LocaleCode da_DK
-
de
public static final LocaleCode de
-
de_AT
public static final LocaleCode de_AT
-
de_CH
public static final LocaleCode de_CH
-
de_DE
public static final LocaleCode de_DE
-
de_LU
public static final LocaleCode de_LU
-
el
public static final LocaleCode el
-
el_CY
public static final LocaleCode el_CY
-
el_GR
public static final LocaleCode el_GR
-
en
public static final LocaleCode en
-
en_AU
public static final LocaleCode en_AU
-
en_CA
public static final LocaleCode en_CA
-
en_GB
public static final LocaleCode en_GB
-
en_HK
public static final LocaleCode en_HK
- Since:
- 1.22
-
en_IE
public static final LocaleCode en_IE
-
en_IN
public static final LocaleCode en_IN
-
en_MT
public static final LocaleCode en_MT
-
en_NZ
public static final LocaleCode en_NZ
-
en_PH
public static final LocaleCode en_PH
-
en_SG
public static final LocaleCode en_SG
-
en_US
public static final LocaleCode en_US
-
en_ZA
public static final LocaleCode en_ZA
-
es
public static final LocaleCode es
-
es_AR
public static final LocaleCode es_AR
-
es_BO
public static final LocaleCode es_BO
-
es_CL
public static final LocaleCode es_CL
-
es_CO
public static final LocaleCode es_CO
-
es_CR
public static final LocaleCode es_CR
-
es_DO
public static final LocaleCode es_DO
-
es_EC
public static final LocaleCode es_EC
-
es_ES
public static final LocaleCode es_ES
-
es_GT
public static final LocaleCode es_GT
-
es_HN
public static final LocaleCode es_HN
-
es_MX
public static final LocaleCode es_MX
-
es_NI
public static final LocaleCode es_NI
-
es_PA
public static final LocaleCode es_PA
-
es_PE
public static final LocaleCode es_PE
-
es_PR
public static final LocaleCode es_PR
-
es_PY
public static final LocaleCode es_PY
-
es_SV
public static final LocaleCode es_SV
-
es_US
public static final LocaleCode es_US
-
es_UY
public static final LocaleCode es_UY
-
es_VE
public static final LocaleCode es_VE
-
et
public static final LocaleCode et
-
et_EE
public static final LocaleCode et_EE
-
fa
public static final LocaleCode fa
- Since:
- 1.21
-
fa_IR
public static final LocaleCode fa_IR
- Since:
- 1.21
-
fi
public static final LocaleCode fi
-
fi_FI
public static final LocaleCode fi_FI
-
fr
public static final LocaleCode fr
-
fr_BE
public static final LocaleCode fr_BE
-
fr_CA
public static final LocaleCode fr_CA
-
fr_CH
public static final LocaleCode fr_CH
-
fr_FR
public static final LocaleCode fr_FR
-
fr_LU
public static final LocaleCode fr_LU
-
ga
public static final LocaleCode ga
-
ga_IE
public static final LocaleCode ga_IE
-
he
public static final LocaleCode he
-
he_IL
public static final LocaleCode he_IL
-
hi_IN
public static final LocaleCode hi_IN
-
hr
public static final LocaleCode hr
-
hr_HR
public static final LocaleCode hr_HR
-
hu
public static final LocaleCode hu
-
hu_HU
public static final LocaleCode hu_HU
-
id
public static final LocaleCode id
-
id_ID
public static final LocaleCode id_ID
-
is
public static final LocaleCode is
-
is_IS
public static final LocaleCode is_IS
-
it
public static final LocaleCode it
-
it_CH
public static final LocaleCode it_CH
-
it_IT
public static final LocaleCode it_IT
-
ja
public static final LocaleCode ja
-
ja_JP
public static final LocaleCode ja_JP
-
kk_KZ
public static final LocaleCode kk_KZ
- Since:
- 1.22
-
ko
public static final LocaleCode ko
-
ko_KR
public static final LocaleCode ko_KR
-
lt
public static final LocaleCode lt
-
lt_LT
public static final LocaleCode lt_LT
-
lv
public static final LocaleCode lv
-
lv_LV
public static final LocaleCode lv_LV
-
mk
public static final LocaleCode mk
-
mk_MK
public static final LocaleCode mk_MK
-
ms
public static final LocaleCode ms
-
ms_MY
public static final LocaleCode ms_MY
-
mt
public static final LocaleCode mt
-
mt_MT
public static final LocaleCode mt_MT
-
nb
public static final LocaleCode nb
- Since:
- 1.8
-
nb_NO
public static final LocaleCode nb_NO
- Since:
- 1.8
-
nl
public static final LocaleCode nl
-
nl_BE
public static final LocaleCode nl_BE
-
nl_NL
public static final LocaleCode nl_NL
-
nn_NO
public static final LocaleCode nn_NO
-
no
public static final LocaleCode no
-
no_NO
public static final LocaleCode no_NO
Deprecated.nb_NO
should be used.
-
pl
public static final LocaleCode pl
-
pl_PL
public static final LocaleCode pl_PL
-
pt
public static final LocaleCode pt
-
pt_BR
public static final LocaleCode pt_BR
-
pt_PT
public static final LocaleCode pt_PT
-
ro
public static final LocaleCode ro
-
ro_MD
public static final LocaleCode ro_MD
-
ro_RO
public static final LocaleCode ro_RO
-
ru
public static final LocaleCode ru
-
ru_KZ
public static final LocaleCode ru_KZ
- Since:
- 1.22
-
ru_RU
public static final LocaleCode ru_RU
-
se
public static final LocaleCode se
- Since:
- 1.8
-
se_NO
public static final LocaleCode se_NO
- Since:
- 1.8
-
sk
public static final LocaleCode sk
-
sk_SK
public static final LocaleCode sk_SK
-
sl
public static final LocaleCode sl
-
sl_SI
public static final LocaleCode sl_SI
-
sq
public static final LocaleCode sq
-
sq_AL
public static final LocaleCode sq_AL
-
sr
public static final LocaleCode sr
-
sr_BA
public static final LocaleCode sr_BA
-
sr_CS
public static final LocaleCode sr_CS
-
sr_ME
public static final LocaleCode sr_ME
-
sr_RS
public static final LocaleCode sr_RS
-
sv
public static final LocaleCode sv
-
sv_SE
public static final LocaleCode sv_SE
-
th
public static final LocaleCode th
-
th_TH
public static final LocaleCode th_TH
-
tr
public static final LocaleCode tr
-
tr_TR
public static final LocaleCode tr_TR
-
uk
public static final LocaleCode uk
-
uk_UA
public static final LocaleCode uk_UA
-
vi
public static final LocaleCode vi
-
vi_VN
public static final LocaleCode vi_VN
-
zh
public static final LocaleCode zh
-
zh_CN
public static final LocaleCode zh_CN
-
zh_HK
public static final LocaleCode zh_HK
-
zh_SG
public static final LocaleCode zh_SG
-
zh_TW
public static final LocaleCode zh_TW
-
-
Field Detail
-
undefinedLocale
private static final java.util.Locale undefinedLocale
-
language
private final LanguageCode language
-
country
private final CountryCode country
-
string
private final java.lang.String string
-
-
Constructor Detail
-
LocaleCode
private LocaleCode(LanguageCode language, CountryCode country)
-
-
Method Detail
-
values
public static LocaleCode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (LocaleCode c : LocaleCode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static LocaleCode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getLanguage
public LanguageCode getLanguage()
Get the language code.- Returns:
- The language code. This method always returns a non-null value.
-
getCountry
public CountryCode getCountry()
Get the country code.- Returns:
- The country code. This method may return null.
For example,
LocaleCode.en
.getCountry() returns null.
-
toString
public java.lang.String toString()
Get the string representation of this locale code. Its format is either of the following:- language
- language
-
country
where language is an ISO 639-1 code and country is an ISO 3166-1 alpha-2 code.
- Overrides:
toString
in classjava.lang.Enum<LocaleCode>
- Returns:
- The string representation of this locale code.
-
toLocale
public java.util.Locale toLocale()
Convert thisLocaleCode
instance to aLocale
instance.In most cases, this method creates a new
Locale
instance every time it is called, but someLocaleCode
instances return their corresponding entries inLocale
class. For example,LocaleCode.it
always returnsLocale.ITALIAN
.The table below lists
LocaleCode
entries whosetoLocale()
does not create a newLocale
instance but returns an entry inLocale
class.LocaleCode Locale LocaleCode.de
Locale.GERMAN
LocaleCode.en
Locale.ENGLISH
LocaleCode.fr
Locale.FRENCH
LocaleCode.fr_CA
Locale.CANADA_FRENCH
LocaleCode.it
Locale.ITALIAN
LocaleCode.ja
Locale.JAPANESE
LocaleCode.ko
Locale.KOREAN
LocaleCode.zh
Locale.CHINESE
LocaleCode.zh_CN
Locale.SIMPLIFIED_CHINESE
LocaleCode.zh_TW
Locale.TRADITIONAL_CHINESE
In addition,
toLocale()
ofLocaleCode.undefined
behaves a bit differently. It returnsLocale.ROOT
when it is available (i.e. when the version of Java SE is 1.6 or higher). Otherwise, it returns aLocale
instance whose language and country are empty strings. Even in the latter case, the same instance is returned on every call.- Returns:
- A
Locale
instance that matches thisLocaleCode
.
-
getByCode
public static LocaleCode getByCode(java.lang.String code)
Get aLocaleCode
instance that corresponds to the given code.This method just calls
getByCode
(code, true)
. Note that the behavior has changed since the version 1.13. In the older versions, this method was an alias ofgetByCode(code, false)
.- Parameters:
code
- A locale code.- Returns:
- A
LocaleCode
instance, ornull
if not found. - See Also:
getByCode(String, boolean)
-
getByCodeIgnoreCase
public static LocaleCode getByCodeIgnoreCase(java.lang.String code)
Get aLocaleCode
instance that corresponds to the given code.This method just calls
getByCode
(code, false)
.- Parameters:
code
- A locale code.- Returns:
- A
LocaleCode
instance, ornull
if not found. - Since:
- 1.13
- See Also:
getByCode(String, boolean)
-
getByCode
public static LocaleCode getByCode(java.lang.String code, boolean caseSensitive)
Get aLocaleCode
instance that corresponds to the given code.The format of the code should be either of the following:
- language
- language
-
country
where language is an ISO 639-1 code and country is an ISO 3166-1 alpha-2 code. The separator between language and country should be a hyphen (
-
) or an underscore (_
).Note that if the language part of the given code is one of legacy ones { "iw", "ji" and "in" }, it is regarded as its newer official counterpart { "he", "yi" and "id" }, respectively.
- Parameters:
code
- A locale code.caseSensitive
- Iftrue
, the language part of the given code must be lower-case and the country part, if notnull
, must be upper-case. If false, this method internally canonicalizes the given code and then performs search.- Returns:
- A
LocaleCode
instance, ornull
if not found.
-
getByCode
public static LocaleCode getByCode(java.lang.String language, java.lang.String country)
Get aLocaleCode
instance that corresponds to the given pair of language code and country code.This method just calls
getByCode
(language, country, true)
. Note that the behavior has changed since the version 1.13. In the older versions, this method was an alias ofgetByCode(language, country, false)
.- Parameters:
language
- ISO 639-1 language code. Or "undefined" (case sensitive). If the given language code is one of legacy ones { "iw", "ji" and "in" }, it is regarded as its newer official counterpart { "he", "yi" and "id" }, respectively.country
- ISO 3166-1 alpha-2 country code. Or "UNDEFINED" (case sensitive).- Returns:
- A
LocaleCode
, ornull
if not found. - See Also:
getByCode(String, String, boolean)
-
getByCodeIgnoreCase
public static LocaleCode getByCodeIgnoreCase(java.lang.String language, java.lang.String country)
Get aLocaleCode
instance that corresponds to the given pair of language code and country code.This method just calls
getByCode
(language, country, false)
.- Parameters:
language
- ISO 639-1 language code. Or "undefined" (case insensitive). If the given language code is one of legacy ones { "iw", "ji" and "in" }, it is regarded as its newer official counterpart { "he", "yi" and "id" }, respectively.country
- ISO 3166-1 alpha-2 country code. Or "UNDEFINED" (case insensitive).- Returns:
- A
LocaleCode
, ornull
if not found. - Since:
- 1.13
- See Also:
getByCode(String, String, boolean)
-
getByCode
public static LocaleCode getByCode(java.lang.String language, java.lang.String country, boolean caseSensitive)
Get aLocaleCode
instance that corresponds to the given pair of language code and country code.If
language
is "undefined" and ifcountry
isnull
or "UNDEFINED",LocaleCode.undefined
is returned.- Parameters:
language
- ISO 639-1 language code. Or "undefined". If the given language code is one of legacy ones { "iw", "ji" and "in" }, it is regarded as its newer official counterpart { "he", "yi" and "id" }, respectively.country
- ISO 3166-1 alpha-2 country code. Or "UNDEFINED".caseSensitive
- Iftrue
, the given language code must be lower-case and the given country code, if notnull
, must be upper-case. Iffalse
, this method internally canonicalizes the given codes and then performs search.- Returns:
- A
LocaleCode
, ornull
if not found.
-
getByLocale
public static LocaleCode getByLocale(java.util.Locale locale)
Get aLocaleCode
instance that corresponds to the givenLocale
instance.- Parameters:
locale
- ALocale
instance.- Returns:
- A
LocaleCode
instance, ornull
if not found. When the value returned bygetLanguage()
method of the given instance isnull
or an empty string and the value returned bygetCountry()
method of the given instance isnull
or an empty string,LocaleCode.undefined
is returned.
-
getByCombinedCode
private static LocaleCode getByCombinedCode(java.lang.String code, boolean caseSensitive, int splitPosition)
-
getByEnumName
private static LocaleCode getByEnumName(java.lang.String name)
-
getByLanguage
public static java.util.List<LocaleCode> getByLanguage(java.lang.String language)
Get a list ofLocaleCode
instances whose language matches the given one.This method is an alias of
getByLanguage
(language, true)
. Note that the behavior has changed since the version 1.13. In the older versions, this method was an alias ofgetByLanguage(language, false)
.- Parameters:
language
- Language code. ISO 639 alpha-2 or alpha-3.- Returns:
- List of
LocaleCode
instances. If there is noLocaleCode
instance whose language matches the given one, the size of the returned list is zero. - Since:
- 1.3
-
getByLanguageIgnoreCase
public static java.util.List<LocaleCode> getByLanguageIgnoreCase(java.lang.String language)
Get a list ofLocaleCode
instances whose language matches the given one.This method is an alias of
getByLanguage
(language, false)
.- Parameters:
language
- Language code. ISO 639 alpha-2 or alpha-3.- Returns:
- List of
LocaleCode
instances. If there is noLocaleCode
instance whose language matches the given one, the size of the returned list is zero. - Since:
- 1.13
-
getByLanguage
public static java.util.List<LocaleCode> getByLanguage(java.lang.String language, boolean caseSensitive)
Get a list ofLocaleCode
instances whose language matches the given one.This method is an alias of
getByLanguage
(
LanguageCode
.
getByCode
(language, caseSensitive))
.- Parameters:
language
- Language code. ISO 639 alpha-2 or alpha-3.caseSensitive
- Iftrue
, the given code should consist of lowercase letters only. Iffalse
, case is ignored.- Returns:
- List of
LocaleCode
instances. If there is noLocaleCode
instance whose language matches the given one, the size of the returned list is zero. - Since:
- 1.3
-
getByLanguage
public static java.util.List<LocaleCode> getByLanguage(LanguageCode language)
Get a list ofLocaleCode
instances whose language matches the given one.- Parameters:
language
-LanguageCode
instance that represents a language.- Returns:
- List of
LocaleCode
instances. If there is noLocaleCode
instance whose language matches the given one, the size of the returned list is zero. - Since:
- 1.3
-
getByCountry
public static java.util.List<LocaleCode> getByCountry(java.lang.String country)
Get a list ofLocaleCode
instances whose country matches the given one.This method is an alias of
getByCountry
(country, true)
. Note that the behavior has changed since the version 1.13. In the older versions, this method was an alias ofgetByCountry(country, false)
.- Parameters:
country
- Country code. ISO 3166-1 alpha-2 or alpha-3.- Returns:
- List of
LocaleCode
instances. If there is noLocaleCode
instance whose country matches the given one, the size of the returned list is zero. - Since:
- 1.3
-
getByCountryIgnoreCase
public static java.util.List<LocaleCode> getByCountryIgnoreCase(java.lang.String country)
Get a list ofLocaleCode
instances whose country matches the given one.This method is an alias of
getByCountry
(country, false)
.- Parameters:
country
- Country code. ISO 3166-1 alpha-2 or alpha-3.- Returns:
- List of
LocaleCode
instances. If there is noLocaleCode
instance whose country matches the given one, the size of the returned list is zero. - Since:
- 1.13
-
getByCountry
public static java.util.List<LocaleCode> getByCountry(java.lang.String country, boolean caseSensitive)
Get a list ofLocaleCode
instances whose country matches the given one.This method is an alias of
getByCountry
(
CountryCode
.
getByCode
(country, caseSensitive))
.- Parameters:
country
- Country code. ISO 3166-1 alpha-2 or alpha-3.caseSensitive
- Iftrue
, the given code should consist of uppercase letters only. Iffalse
, case is ignored.- Returns:
- List of
LocaleCode
instances. If there is noLocaleCode
instance whose country matches the given one, the size of the returned list is zero. - Since:
- 1.3
-
getByCountry
public static java.util.List<LocaleCode> getByCountry(CountryCode country)
Get a list ofLocaleCode
instances whose country matches the given one.- Parameters:
country
-CountryCode
instance that represents a country.- Returns:
- List of
LocaleCode
instances. If there is noLocaleCode
instance whose country matches the given one, the size of the returned list is zero. - Since:
- 1.3
-
getUndefinedLocale
private static java.util.Locale getUndefinedLocale()
-
-