public class LocaleUtils
extends org.apache.commons.lang3.LocaleUtils
LocaleUtils
with more tools.Constructor and Description |
---|
LocaleUtils() |
Modifier and Type | Method and Description |
---|---|
static Locale |
getParentLocale(Locale locale) |
static Locale |
toLocale(String str)
Extends
LocaleUtils which return Locale.ROOT for an empty string. |
static Locale |
toLocale(String str,
Locale fallback)
Same as
toLocale(String) but it never throws an exception. |
public static Locale getParentLocale(Locale locale)
locale
- the localepublic static Locale toLocale(String str)
LocaleUtils
which return Locale.ROOT
for an empty string.str
- the locale String to convert, null returns nullIllegalArgumentException
- if the string is an invalid formatpublic static Locale toLocale(String str, Locale fallback)
toLocale(String)
but it never throws an exception. It returns the passed fallback locale in case
the given string locale has an invalid format.str
- the locale string to convert, null returns nullfallback
- the locale to return as fallback in case the given locale string has an invalid formattoLocale(String)
Copyright © 2004–2021 XWiki. All rights reserved.