Interface I18nContextProvider.Builder

All Known Subinterfaces:
I18nSpringContextProvider.Builder, SharedI18nContextProvider.Builder, ThreadI18nContextProvider.Builder
All Known Implementing Classes:
I18nSpringContextProvider.BuilderImpl, SharedI18nContextProvider.BuilderImpl, ThreadI18nContextProvider.BuilderImpl
Enclosing interface:
I18nContextProvider

@API(status=STABLE, since="0.1") public static interface I18nContextProvider.Builder
Builder of I18N context provider instances.
Since:
0.1
Version:
1.0, 2024-09
Author:
(w) Iker Hernaez
  • Method Details

    • configure

      @NotNull default @NotNull I18nContextProvider.Builder configure()
      Configures the builder with I18N configuration for the current class loader.
      Returns:
      This builder, for method chaining.
      See Also:
    • configure

      @NotNull @NotNull I18nContextProvider.Builder configure(@NotNull @NotNull Properties config)
      Configures the builder with specified I18N configuration.
      Parameters:
      config - The I18N configuration.
      Returns:
      This instance, for method chaining.
    • setDefaultLocaleSupplier

      @NotNull @NotNull I18nContextProvider.Builder setDefaultLocaleSupplier(@NotNull @NotNull Supplier<@NotNull Locale> supplier)
      Sets the default locale supplier.
      Parameters:
      supplier - The default locale supplier.
      Returns:
      This instance, for method chaining.
    • setAvailableLocales

      @NotNull @NotNull I18nContextProvider.Builder setAvailableLocales(@NotNull @NotNull Locale[] locales)
      Sets the available locales.
      Parameters:
      locales - The available locales.
      Returns:
      This instance, for method chaining.
    • setDefaultI18nResources

      @NotNull @NotNull I18nContextProvider.Builder setDefaultI18nResources(@NotNull @NotNull I18nResources resources)
      Sets the default I18N resources.
      Parameters:
      resources - The default I18N resources
      Returns:
      This instance, for method chaining.
    • addI18nResources

      @NotNull @NotNull I18nContextProvider.Builder addI18nResources(@NotNull @NotNull String key, @NotNull @NotNull I18nResources resource)
      Adds alternative I18N resources to be used when the specified key is used.
      Parameters:
      key - The key of the alternative I18N resources
      resource - The alternative I18N resources
      Returns:
      This instance, for method chaining.
    • build

      @NotNull @NotNull I18nContextProvider build()
      Builds an immutable I18N context provider instance with the current configuration of this builder. Further modifications to the builder will have no effect in the returned instance.
      Returns:
      The I18N context provider instance.