- Type Parameters:
S- The concrete type of the builder.
- All Known Subinterfaces:
CommonsConfigBuilder,CommonsMutableConfigBuilder,EnvironmentConfigBuilder,JsonConfigBaseBuilder<S>,JsonConfigBuilder,JsonMutableConfigBuilder,MutableCapableConfigBuilder<S>,MutableConfigBuilder<S>,PreferencesConfigBuilder,PreferencesMutableConfigBuilder,PropertiesConfigBaseBuilder<S>,PropertiesConfigBuilder,PropertiesMutableConfigBuilder,SpringEnvironmentConfigBuilder,SystemConfigBuilder,XmlConfigBaseBuilder<S>,XmlConfigBuilder,XmlMutableConfigBuilder,YamlConfigBaseBuilder<S>,YamlConfigBuilder,YamlMutableConfigBuilder
- All Known Implementing Classes:
AbstractConfigBuilderImpl,AbstractMutableConfigBuilderImpl,CommonsConfigBuilderImpl,CommonsMutableConfigBuilderImpl,EnvironmentConfigBuilderImpl,JsonConfigBuilderImpl,JsonMutableConfigBuilderImpl,PreferencesConfigBuilderImpl,PreferencesMutableConfigBuilderImpl,PropertiesConfigBuilderImpl,PropertiesMutableConfigBuilderImpl,SpringEnvironmentConfigBuilderImpl,SystemConfigBuilderImpl,XmlConfigBuilderImpl,XmlMutableConfigBuilderImpl,YamlConfigBuilderImpl,YamlMutableConfigBuilderImpl
@API(status=STABLE,
since="1.0")
public interface ConfigBuilder<S extends ConfigBuilder<S>>
Configuration builder.
- Since:
- 1.0
- Version:
- 1.0, 2025-05
- Author:
- (w) Iker Hernaez
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T extends Config>
TCreates the configuration instance as an instance of the specified configuration type.@NotNull Configbuild()Creates the configuration instance.withDecoder(ValueDecoder encoder) Sets the configuration properties values decoder.withDecorator(ValueDecorator decorator) Sets the configuration properties values decorator.withEncryption(ConfigCryptoProvider provider) Sets the configuration properties values cryptography transformations provider.Sets whether the configuration properties values from the parent configuration (if any) must be overridden by the properties values from this configuration.default SwithParent(@NotNull ConfigBuilder<?> parent) Sets the parent configuration.withParent(Config parent) Sets the parent configuration.Enables configuration property values variable resolution.
-
Method Details
-
withParent
Sets the parent configuration.- Parameters:
parent- The parent configuration.- Returns:
- This instance, for method chaining.
-
withParent
Sets the parent configuration.This is a shortcut for
withParent(parent.build())that allows less verbose configuration hierarchies building.- Parameters:
parent- The parent configuration.- Returns:
- This instance, for method chaining.
-
withOverrideParentProperties
Sets whether the configuration properties values from the parent configuration (if any) must be overridden by the properties values from this configuration.By default, parent configuration properties values are not overridden. Thus, if a property is defined both in current configuration and in the parent configuration, the value from the parent configuration will be returned.
- Returns:
- This instance, for method chaining.
-
withEncryption
Sets the configuration properties values cryptography transformations provider.- Parameters:
provider- The cryptography transformations provider.- Returns:
- This instance, for method chaining.
-
withDecoder
Sets the configuration properties values decoder. Applied to property values contained in the builded configuration instance (not to the parent configuration properties, if any).- Parameters:
encoder- The configuration properties values decoder.- Returns:
- This instance, for method chaining.
-
withVariableResolution
Enables configuration property values variable resolution.- Returns:
- This instance, for method chaining.
-
withDecorator
Sets the configuration properties values decorator. Applied to property values returned by the builded configuration instance (whatever its source).- Parameters:
decorator- The configuration properties values decorator.- Returns:
- This instance, for method chaining.
-
build
Creates the configuration instance.- Returns:
- The configuration instance.
-
as
Creates the configuration instance as an instance of the specified configuration type.This is a shortcut for
Config.as(build(), configType).- Type Parameters:
T- The configuration sub-type.- Parameters:
configType- The configuration sub-type.- Returns:
- The configuration instance.
- See Also:
-