Package dev.orne.i18n.spring
Class I18nSpringContextProvider.BuilderImpl<T extends I18nSpringContextProvider,B extends I18nSpringContextProvider.BuilderImpl<T,B>>
java.lang.Object
dev.orne.i18n.context.AbstractI18nContextProvider.BuilderImpl<T,B>
dev.orne.i18n.context.ThreadI18nContextProvider.BuilderImpl<T,B>
dev.orne.i18n.spring.I18nSpringContextProvider.BuilderImpl<T,B>
- Type Parameters:
T
- The type of I18N context provider build by the builder.B
- The type of builder returned for method chaining.
- All Implemented Interfaces:
I18nContextProvider.Builder
,ThreadI18nContextProvider.Builder
,I18nSpringContextProvider.Builder
- Enclosing class:
- I18nSpringContextProvider
protected static class I18nSpringContextProvider.BuilderImpl<T extends I18nSpringContextProvider,B extends I18nSpringContextProvider.BuilderImpl<T,B>>
extends ThreadI18nContextProvider.BuilderImpl<T,B>
implements I18nSpringContextProvider.Builder
Builder of
I18nSpringContextProvider
instances.- Since:
- 0.1
- Version:
- 1.0, 2024-09
- Author:
- (w) Iker Hernaez
-
Field Summary
Fields inherited from class dev.orne.i18n.context.ThreadI18nContextProvider.BuilderImpl
inheritableContexts
Fields inherited from class dev.orne.i18n.context.AbstractI18nContextProvider.BuilderImpl
availableLocales, defaultI18nResources, defaultLocaleSupplier, i18nResources
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddI18nResources
(@NotNull String key, @NotNull org.springframework.context.MessageSource messageSource) Adds alternative I18N resources to be used when the specified key is used.@NotNull I18nSpringContextProvider
build()
Builds an immutable I18N context provider instance with the current configuration of this builder.setDefaultI18nResources
(@NotNull org.springframework.context.MessageSource messageSource) Sets the default I18N resources.Methods inherited from class dev.orne.i18n.context.ThreadI18nContextProvider.BuilderImpl
configure, configureInheritable, setInheritableContexts
Methods inherited from class dev.orne.i18n.context.AbstractI18nContextProvider.BuilderImpl
addI18nResources, configureAlternativeI18nResources, configureAvailableLocalesSupplier, configureDefaultI18nResources, configureDefaultLocaleSupplier, setAvailableLocales, setDefaultI18nResources, setDefaultLocaleSupplier
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.orne.i18n.spring.I18nSpringContextProvider.Builder
addI18nResources, configure, configure, setAvailableLocales, setDefaultI18nResources, setDefaultLocaleSupplier, setInheritableContexts
-
Constructor Details
-
BuilderImpl
protected BuilderImpl()Creates a new instance.
-
-
Method Details
-
setDefaultI18nResources
@NotNull public B setDefaultI18nResources(@NotNull @NotNull org.springframework.context.MessageSource messageSource) Sets the default I18N resources.- Specified by:
setDefaultI18nResources
in interfaceI18nSpringContextProvider.Builder
- Parameters:
messageSource
- The default Spring message source- Returns:
- This builder, for method chaining.
-
addI18nResources
@NotNull public B addI18nResources(@NotNull @NotNull String key, @NotNull @NotNull org.springframework.context.MessageSource messageSource) Adds alternative I18N resources to be used when the specified key is used.- Specified by:
addI18nResources
in interfaceI18nSpringContextProvider.Builder
- Parameters:
key
- The key of the alternative I18N resourcesmessageSource
- The default Spring message source- Returns:
- This builder, for method chaining.
-
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.- Specified by:
build
in interfaceI18nContextProvider.Builder
- Specified by:
build
in interfaceI18nSpringContextProvider.Builder
- Specified by:
build
in interfaceThreadI18nContextProvider.Builder
- Overrides:
build
in classThreadI18nContextProvider.BuilderImpl<T extends I18nSpringContextProvider,
B extends I18nSpringContextProvider.BuilderImpl<T, B>> - Returns:
- The I18N context provider instance.
-