Package com.networknt.schema.i18n
Class Locales
java.lang.Object
com.networknt.schema.i18n.Locales
Functions for working with Locales.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]
The list of locale resource bundles.The supported locales. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Locale
findSupported
(String priorityList) Determine the best matchingLocale
with respect to the priority list.static Locale
findSupported
(String priorityList, Collection<Locale> locales) Determine the best matchingLocale
with respect to the priority list.static Locale
findSupported
(List<Locale.LanguageRange> priorityList, Collection<Locale> locales, Locale.FilteringMode filteringMode) Determine the best matchingLocale
with respect to the priority list.Gets the supported locales.Gets a list ofLocale
by language tags.
-
Field Details
-
SUPPORTED_LANGUAGE_TAGS
The list of locale resource bundles. -
SUPPORTED_LOCALES
The supported locales.
-
-
Constructor Details
-
Locales
public Locales()
-
-
Method Details
-
getSupportedLocales
Gets the supported locales.- Returns:
- the supported locales
-
of
Gets a list ofLocale
by language tags.- Parameters:
languageTags
- for the locales- Returns:
- the locales
-
findSupported
Determine the best matchingLocale
with respect to the priority list.- Parameters:
priorityList
- the language tag priority list- Returns:
- the best matching locale
-
findSupported
Determine the best matchingLocale
with 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 matchingLocale
with respect to the priority list.- Parameters:
priorityList
- the language tag priority listlocales
- the supported localesfilteringMode
- the filtering mode- Returns:
- the best matching locale
-