Class AbstractConfigBuilderImpl<S extends ConfigBuilder<S>>

java.lang.Object
dev.orne.config.impl.AbstractConfigBuilderImpl<S>
Type Parameters:
S - The concrete type of the builder.
All Implemented Interfaces:
ConfigBuilder<S>
Direct Known Subclasses:
AbstractMutableConfigBuilderImpl, CommonsConfigBuilderImpl, EnvironmentConfigBuilderImpl, JsonConfigBuilderImpl, PreferencesConfigBuilderImpl, PropertiesConfigBuilderImpl, SpringEnvironmentConfigBuilderImpl, SystemConfigBuilderImpl, XmlConfigBuilderImpl, YamlConfigBuilderImpl

@API(status=INTERNAL, since="1.0") public abstract class AbstractConfigBuilderImpl<S extends ConfigBuilder<S>> extends Object implements ConfigBuilder<S>
Base abstract implementation of configuration builder.
Since:
1.0
Version:
1.0, 2025-05
Author:
(w) Iker Hernaez
See Also:
  • Field Details

    • options

      @NotNull protected final @NotNull ConfigOptions options
      The configuration options.
  • Constructor Details

    • AbstractConfigBuilderImpl

      protected AbstractConfigBuilderImpl()
      Empty constructor.
    • AbstractConfigBuilderImpl

      protected AbstractConfigBuilderImpl(@NotNull @NotNull ConfigOptions options)
      Copy constructor.
      Parameters:
      options - The configuration options to copy.
  • Method Details

    • withParent

      @NotNull public S withParent(Config parent)
      Sets the parent configuration.
      Specified by:
      withParent in interface ConfigBuilder<S extends ConfigBuilder<S>>
      Parameters:
      parent - The parent configuration.
      Returns:
      This instance, for method chaining.
    • withOverrideParentProperties

      @NotNull public S 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.

      Specified by:
      withOverrideParentProperties in interface ConfigBuilder<S extends ConfigBuilder<S>>
      Returns:
      This instance, for method chaining.
    • withEncryption

      @NotNull public S withEncryption(ConfigCryptoProvider provider)
      Sets the configuration properties values cryptography transformations provider.
      Specified by:
      withEncryption in interface ConfigBuilder<S extends ConfigBuilder<S>>
      Parameters:
      provider - The cryptography transformations provider.
      Returns:
      This instance, for method chaining.
    • withDecoder

      @NotNull public S withDecoder(ValueDecoder decoder)
      Sets the configuration properties values decoder. Applied to property values contained in the builded configuration instance (not to the parent configuration properties, if any).
      Specified by:
      withDecoder in interface ConfigBuilder<S extends ConfigBuilder<S>>
      Parameters:
      decoder - The configuration properties values decoder.
      Returns:
      This instance, for method chaining.
    • withVariableResolution

      @NotNull public S withVariableResolution()
      Enables configuration property values variable resolution.
      Specified by:
      withVariableResolution in interface ConfigBuilder<S extends ConfigBuilder<S>>
      Returns:
      This instance, for method chaining.
    • withDecorator

      @NotNull public S withDecorator(ValueDecorator decorator)
      Sets the configuration properties values decorator. Applied to property values returned by the builded configuration instance (whatever its source).
      Specified by:
      withDecorator in interface ConfigBuilder<S extends ConfigBuilder<S>>
      Parameters:
      decorator - The configuration properties values decorator.
      Returns:
      This instance, for method chaining.
    • thisBuilder

      @NotNull protected S thisBuilder()
      Returns this builder instance.
      Returns:
      This builder instance.