ConfigBuilder

Defines a builder for configuration objects. It allows for incremental configuration and override by providing a base configuration object and applying modifications to it.

The configuration process is as follows:

  1. Begin with a default or initial (base) configuration object;

  2. Pass this configuration to a configuration builder;

  3. On top of the builder, apply the desired configuration properties;

  4. Generate a new configuration from the builder;

  5. If further modifications are needed, pass the new configuration back to the builder, which will use it as the base configuration;

  6. Repeat the process until the desired configuration is achieved.

Additionally, the builder also has the additional responsibility of validating the configuration properties before a configuration is generated.

Parameters

TConfig

the type of the configuration object to be built

Inheritors

Properties

Link copied to clipboard
abstract val baseConfig: TConfig

The base configuration object to be used as a starting point for building the final configuration object.

Functions

Link copied to clipboard
abstract fun build(): TConfig

Builds the final configuration object after applying possible modifications to the base configuration.