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 arar_AEar_BHar_DZar_EGar_IQar_JOar_KWar_LBar_LYar_MAar_OMar_QAar_SAar_SDar_SYar_TNar_YEbebe_BYbgbg_BGcaca_EScscs_CZdada_DKdede_ATde_CHde_DEde_LUelel_CYel_GRenen_AUen_CAen_GBen_HKen_IEen_INen_MTen_NZen_PHen_SGen_USen_ZAeses_ARes_BOes_CLes_COes_CRes_DOes_ECes_ESes_GTes_HNes_MXes_NIes_PAes_PEes_PRes_PYes_SVes_USes_UYes_VEetet_EEfafa_IRfifi_FIfrfr_BEfr_CAfr_CHfr_FRfr_LUgaga_IEhehe_ILhi_INhrhr_HRhuhu_HUidid_IDisis_ISitit_CHit_ITjaja_JPkk_KZkoko_KRltlt_LTlvlv_LVmkmk_MKmsms_MYmtmt_MTnbnb_NOnlnl_BEnl_NLnn_NOnono_NODeprecated.nb_NOshould be used.plpl_PLptpt_BRpt_PTroro_MDro_ROruru_KZru_RUsese_NOsksk_SKslsl_SIsqsq_ALsrsr_BAsr_CSsr_MEsr_RSsvsv_SEthth_THtrtr_TRukuk_UAundefinedvivi_VNzhzh_CNzh_HKzh_SGzh_TW
-
Field Summary
Fields Modifier and Type Field Description private CountryCodecountryprivate LanguageCodelanguageprivate java.lang.Stringstringprivate static java.util.LocaleundefinedLocale
-
Constructor Summary
Constructors Modifier Constructor Description privateLocaleCode(LanguageCode language, CountryCode country)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LocaleCodegetByCode(java.lang.String code)Get aLocaleCodeinstance that corresponds to the given code.static LocaleCodegetByCode(java.lang.String code, boolean caseSensitive)Get aLocaleCodeinstance that corresponds to the given code.static LocaleCodegetByCode(java.lang.String language, java.lang.String country)Get aLocaleCodeinstance that corresponds to the given pair of language code and country code.static LocaleCodegetByCode(java.lang.String language, java.lang.String country, boolean caseSensitive)Get aLocaleCodeinstance that corresponds to the given pair of language code and country code.static LocaleCodegetByCodeIgnoreCase(java.lang.String code)Get aLocaleCodeinstance that corresponds to the given code.static LocaleCodegetByCodeIgnoreCase(java.lang.String language, java.lang.String country)Get aLocaleCodeinstance that corresponds to the given pair of language code and country code.private static LocaleCodegetByCombinedCode(java.lang.String code, boolean caseSensitive, int splitPosition)static java.util.List<LocaleCode>getByCountry(CountryCode country)Get a list ofLocaleCodeinstances whose country matches the given one.static java.util.List<LocaleCode>getByCountry(java.lang.String country)Get a list ofLocaleCodeinstances whose country matches the given one.static java.util.List<LocaleCode>getByCountry(java.lang.String country, boolean caseSensitive)Get a list ofLocaleCodeinstances whose country matches the given one.static java.util.List<LocaleCode>getByCountryIgnoreCase(java.lang.String country)Get a list ofLocaleCodeinstances whose country matches the given one.private static LocaleCodegetByEnumName(java.lang.String name)static java.util.List<LocaleCode>getByLanguage(LanguageCode language)Get a list ofLocaleCodeinstances whose language matches the given one.static java.util.List<LocaleCode>getByLanguage(java.lang.String language)Get a list ofLocaleCodeinstances whose language matches the given one.static java.util.List<LocaleCode>getByLanguage(java.lang.String language, boolean caseSensitive)Get a list ofLocaleCodeinstances whose language matches the given one.static java.util.List<LocaleCode>getByLanguageIgnoreCase(java.lang.String language)Get a list ofLocaleCodeinstances whose language matches the given one.static LocaleCodegetByLocale(java.util.Locale locale)Get aLocaleCodeinstance that corresponds to the givenLocaleinstance.CountryCodegetCountry()Get the country code.LanguageCodegetLanguage()Get the language code.private static java.util.LocalegetUndefinedLocale()java.util.LocaletoLocale()Convert thisLocaleCodeinstance to aLocaleinstance.java.lang.StringtoString()Get the string representation of this locale code.static LocaleCodevalueOf(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_NOshould 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:
toStringin classjava.lang.Enum<LocaleCode>- Returns:
- The string representation of this locale code.
-
toLocale
public java.util.Locale toLocale()
Convert thisLocaleCodeinstance to aLocaleinstance.In most cases, this method creates a new
Localeinstance every time it is called, but someLocaleCodeinstances return their corresponding entries inLocaleclass. For example,LocaleCode.italways returnsLocale.ITALIAN.The table below lists
LocaleCodeentries whosetoLocale()does not create a newLocaleinstance but returns an entry inLocaleclass.LocaleCode Locale LocaleCode.deLocale.GERMANLocaleCode.enLocale.ENGLISHLocaleCode.frLocale.FRENCHLocaleCode.fr_CALocale.CANADA_FRENCHLocaleCode.itLocale.ITALIANLocaleCode.jaLocale.JAPANESELocaleCode.koLocale.KOREANLocaleCode.zhLocale.CHINESELocaleCode.zh_CNLocale.SIMPLIFIED_CHINESELocaleCode.zh_TWLocale.TRADITIONAL_CHINESEIn addition,
toLocale()ofLocaleCode.undefinedbehaves a bit differently. It returnsLocale.ROOTwhen it is available (i.e. when the version of Java SE is 1.6 or higher). Otherwise, it returns aLocaleinstance whose language and country are empty strings. Even in the latter case, the same instance is returned on every call.- Returns:
- A
Localeinstance that matches thisLocaleCode.
-
getByCode
public static LocaleCode getByCode(java.lang.String code)
Get aLocaleCodeinstance 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
LocaleCodeinstance, ornullif not found. - See Also:
getByCode(String, boolean)
-
getByCodeIgnoreCase
public static LocaleCode getByCodeIgnoreCase(java.lang.String code)
Get aLocaleCodeinstance that corresponds to the given code.This method just calls
getByCode(code, false).- Parameters:
code- A locale code.- Returns:
- A
LocaleCodeinstance, ornullif not found. - Since:
- 1.13
- See Also:
getByCode(String, boolean)
-
getByCode
public static LocaleCode getByCode(java.lang.String code, boolean caseSensitive)
Get aLocaleCodeinstance 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
LocaleCodeinstance, ornullif not found.
-
getByCode
public static LocaleCode getByCode(java.lang.String language, java.lang.String country)
Get aLocaleCodeinstance 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, ornullif not found. - See Also:
getByCode(String, String, boolean)
-
getByCodeIgnoreCase
public static LocaleCode getByCodeIgnoreCase(java.lang.String language, java.lang.String country)
Get aLocaleCodeinstance 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, ornullif 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 aLocaleCodeinstance that corresponds to the given pair of language code and country code.If
languageis "undefined" and ifcountryisnullor "UNDEFINED",LocaleCode.undefinedis 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, ornullif not found.
-
getByLocale
public static LocaleCode getByLocale(java.util.Locale locale)
Get aLocaleCodeinstance that corresponds to the givenLocaleinstance.- Parameters:
locale- ALocaleinstance.- Returns:
- A
LocaleCodeinstance, ornullif not found. When the value returned bygetLanguage()method of the given instance isnullor an empty string and the value returned bygetCountry()method of the given instance isnullor an empty string,LocaleCode.undefinedis 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 ofLocaleCodeinstances 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
LocaleCodeinstances. If there is noLocaleCodeinstance 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 ofLocaleCodeinstances 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
LocaleCodeinstances. If there is noLocaleCodeinstance 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 ofLocaleCodeinstances 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
LocaleCodeinstances. If there is noLocaleCodeinstance 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 ofLocaleCodeinstances whose language matches the given one.- Parameters:
language-LanguageCodeinstance that represents a language.- Returns:
- List of
LocaleCodeinstances. If there is noLocaleCodeinstance 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 ofLocaleCodeinstances 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
LocaleCodeinstances. If there is noLocaleCodeinstance 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 ofLocaleCodeinstances 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
LocaleCodeinstances. If there is noLocaleCodeinstance 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 ofLocaleCodeinstances 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
LocaleCodeinstances. If there is noLocaleCodeinstance 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 ofLocaleCodeinstances whose country matches the given one.- Parameters:
country-CountryCodeinstance that represents a country.- Returns:
- List of
LocaleCodeinstances. If there is noLocaleCodeinstance whose country matches the given one, the size of the returned list is zero. - Since:
- 1.3
-
getUndefinedLocale
private static java.util.Locale getUndefinedLocale()
-
-