Package io.rincl

Interface LocaleSelectable

    • 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 is null.
        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 to getLocale(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 is null.
        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 is null.
        See Also:
        setLocale(Locale.Category, Locale), getLocale(Locale.Category)