Modifier and Type | Method and Description |
---|---|
static Locale |
addMissingCountry(Locale locale)
Adds the country to the supplied locale, but only when it is missing.
|
static Locale |
getLocale(Locale locale)
Gets the supplied locale or the default locale when the supplied locale
is null.
|
static boolean |
isInstalledLocale(Locale locale)
Determines whether the supplied locale is one of the installed locales.
|
static boolean |
isValidIsoCountry(String alpha2Code)
Determines whether the supplied alpha2Code is a valid 2 letter ISO-3166
country or not.
|
static Locale |
valueOf(String locale)
Converts the supplied locale from a String to a Locale.
|
public static Locale valueOf(String locale)
locale
- String representation of a Locale.
Locale.toString()
for the format that this method
expects, with the exception that the language must be present.IllegalArgumentException
- When no locale can be created from the supplied locale.NullPointerException
- When the supplied locale is null.public static Locale addMissingCountry(Locale locale)
locale
- The locale to add the missing country information to.NullPointerException
- When the supplied locale is null.public static boolean isValidIsoCountry(String alpha2Code)
alpha2Code
- The 2 letter code to check.Locale.getISOCountries()
public static Locale getLocale(Locale locale)
locale
- The locale.
public static boolean isInstalledLocale(Locale locale)
locale
- The locale to check.Copyright © 2008–2018. All rights reserved.