Package io.rincl
Interface LocaleSelectable
-
- All Known Subinterfaces:
ResourceI18nConcern
- All Known Implementing Classes:
AbstractResourceI18nConcern
,BaseResourceI18nConcern
,EmptyResourceI18nConcern
,LocaleSelection
public interface LocaleSelectable
Allows selection of locale for locale category.- Author:
- Garret Wilson
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Locale
getLocale(java.util.Locale.Category category)
Retrieves the configured locale for the given category.default void
setLocale(java.util.Locale locale)
Configures the locale for all locale categories.void
setLocale(java.util.Locale.Category category, java.util.Locale locale)
Configures the locale for the given locale category.
-
-
-
Method Detail
-
getLocale
java.util.Locale getLocale(@Nonnull java.util.Locale.Category category)
Retrieves the configured locale for the given category.- Parameters:
category
- The category of locale to return.- Returns:
- The the configured locale for the given category.
- Throws:
java.lang.NullPointerException
- if the given category isnull
.- See Also:
setLocale(Locale.Category, Locale)
,Locale.getDefault(Locale.Category)
-
setLocale
void setLocale(@Nonnull java.util.Locale.Category category, @Nonnull java.util.Locale locale)
Configures the locale for the given locale category. Future calls togetLocale(Locale.Category)
will return the value set here.- Parameters:
category
- The category for which the locale should be set.locale
- The new locale value.- Throws:
java.lang.NullPointerException
- if the given category and/or new locale isnull
.- See Also:
getLocale(Locale.Category)
-
setLocale
default void setLocale(@Nonnull java.util.Locale locale)
Configures the locale for all locale categories.This is a convenience method to set all locale categories.
- Parameters:
locale
- The new locale value.- Throws:
java.lang.NullPointerException
- if the given category and/or new locale isnull
.- See Also:
setLocale(Locale.Category, Locale)
,getLocale(Locale.Category)
-
-