Package org.elasticsearch.common.util
Class LocaleUtils
- java.lang.Object
-
- org.elasticsearch.common.util.LocaleUtils
-
-
Constructor Summary
Constructors Constructor Description LocaleUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Localeparse(String localeStr)Parse the given locale aslanguage,language-countryorlanguage-country-variant.
-
-
-
Method Detail
-
parse
public static Locale parse(String localeStr)
Parse the given locale aslanguage,language-countryorlanguage-country-variant. Either underscores or hyphens may be used as separators, but consistently, ie. you may not use an hyphen to separate the language from the country and an underscore to separate the country from the variant.- Throws:
IllegalArgumentException- if there are too many parts in the locale stringIllegalArgumentException- if the language or country is not recognized
-
-