Package com.networknt.schema.i18n
Class Locales
- java.lang.Object
-
- com.networknt.schema.i18n.Locales
-
public class Locales extends Object
Functions for working with Locales.
-
-
Field Summary
Fields Modifier and Type Field Description static String[]SUPPORTED_LANGUAGE_TAGSThe list of locale resource bundles.static List<Locale>SUPPORTED_LOCALESThe supported locales.
-
Constructor Summary
Constructors Constructor Description Locales()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static LocalefindSupported(String priorityList)Determine the best matchingLocalewith respect to the priority list.static LocalefindSupported(String priorityList, Collection<Locale> locales)Determine the best matchingLocalewith respect to the priority list.static LocalefindSupported(List<Locale.LanguageRange> priorityList, Collection<Locale> locales, Locale.FilteringMode filteringMode)Determine the best matchingLocalewith respect to the priority list.static List<Locale>getSupportedLocales()Gets the supported locales.static List<Locale>of(String... languageTags)Gets a list ofLocaleby language tags.
-
-
-
Method Detail
-
getSupportedLocales
public static List<Locale> getSupportedLocales()
Gets the supported locales.- Returns:
- the supported locales
-
of
public static List<Locale> of(String... languageTags)
Gets a list ofLocaleby language tags.- Parameters:
languageTags- for the locales- Returns:
- the locales
-
findSupported
public static Locale findSupported(String priorityList)
Determine the best matchingLocalewith respect to the priority list.- Parameters:
priorityList- the language tag priority list- Returns:
- the best matching locale
-
findSupported
public static Locale findSupported(String priorityList, Collection<Locale> locales)
Determine the best matchingLocalewith respect to the priority list.- Parameters:
priorityList- the language tag priority listlocales- the supported locales- Returns:
- the best matching locale
-
findSupported
public static Locale findSupported(List<Locale.LanguageRange> priorityList, Collection<Locale> locales, Locale.FilteringMode filteringMode)
Determine the best matchingLocalewith respect to the priority list.- Parameters:
priorityList- the language tag priority listlocales- the supported localesfilteringMode- the filtering mode- Returns:
- the best matching locale
-
-