Package dev.orne.i18n.context
Class ThreadI18nContextProvider.BuilderImpl<T extends ThreadI18nContextProvider,B extends ThreadI18nContextProvider.BuilderImpl<T,B>>
java.lang.Object
dev.orne.i18n.context.AbstractI18nContextProvider.BuilderImpl<T,B>
dev.orne.i18n.context.ThreadI18nContextProvider.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
- Direct Known Subclasses:
I18nSpringContextProvider.BuilderImpl
- Enclosing class:
- ThreadI18nContextProvider
protected static class ThreadI18nContextProvider.BuilderImpl<T extends ThreadI18nContextProvider,B extends ThreadI18nContextProvider.BuilderImpl<T,B>>
extends AbstractI18nContextProvider.BuilderImpl<T,B>
implements ThreadI18nContextProvider.Builder
Abstract builder of
ThreadI18nContextProvider instances.- Since:
- 0.1
- Version:
- 1.0, 2024-09
- Author:
- (w) Iker Hernaez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanIf theI18nContextinstances should be inherited by childThreads.Fields inherited from class dev.orne.i18n.context.AbstractI18nContextProvider.BuilderImpl
availableLocales, defaultI18nResources, defaultLocaleSupplier, i18nResources -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull ThreadI18nContextProviderbuild()Builds an immutable I18N context provider instance with the current configuration of this builder.configure(@NotNull Properties config) Configures the builder with specified I18N configuration.protected voidconfigureInheritable(@NotNull Properties config) Configures the default language based on specified configuration.setInheritableContexts(@javax.validation.constraints.NotNull boolean inheritable) Sets if theI18nContextinstances will be inherited by child threads.Methods inherited from class dev.orne.i18n.context.AbstractI18nContextProvider.BuilderImpl
addI18nResources, configureAlternativeI18nResources, configureAvailableLocalesSupplier, configureDefaultI18nResources, configureDefaultLocaleSupplier, setAvailableLocales, setDefaultI18nResources, setDefaultLocaleSupplierMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.orne.i18n.context.ThreadI18nContextProvider.Builder
addI18nResources, configure, setAvailableLocales, setDefaultI18nResources, setDefaultLocaleSupplier
-
Field Details
-
inheritableContexts
protected boolean inheritableContextsIf theI18nContextinstances should be inherited by childThreads.
-
-
Constructor Details
-
BuilderImpl
protected BuilderImpl()Creates a new instance.
-
-
Method Details
-
configure
Configures the builder with specified I18N configuration.- Specified by:
configurein interfaceI18nContextProvider.Builder- Specified by:
configurein interfaceThreadI18nContextProvider.Builder- Overrides:
configurein classAbstractI18nContextProvider.BuilderImpl<T extends ThreadI18nContextProvider,B extends ThreadI18nContextProvider.BuilderImpl<T, B>> - Parameters:
config- The I18N configuration.- Returns:
- This builder, for method chaining.
- See Also:
-
configureInheritable
Configures the default language based on specified configuration.- Parameters:
config- The I18N configuration.
-
setInheritableContexts
@NotNull public B setInheritableContexts(@NotNull @javax.validation.constraints.NotNull boolean inheritable) Sets if theI18nContextinstances will be inherited by child threads.- Specified by:
setInheritableContextsin interfaceThreadI18nContextProvider.Builder- Parameters:
inheritable- If theI18nContextinstances will be inherited by child threads.- 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:
buildin interfaceI18nContextProvider.Builder- Specified by:
buildin interfaceThreadI18nContextProvider.Builder- Returns:
- The I18N context provider instance.
-