10Duke Java Core
Loading...
Searching...
No Matches
tenduke.sdk.core.model.config.ConfigBuilder< C extends Configuration > Interface Template Reference

Detailed Description

Interface to implement for assembling configurations from multiple data sources.

The builder defines two stages:

  1. adding configuration instances (configuration sources)
  2. building the outcome configuration

The requirement is to implement logic equivalent to a Java List type ordering. Getting configuration values from the resulting configuration must prefer values by order of added configuration sources. In other words, the stack must implement fallback behavior.

Parameters
<C>Type of configuration.

Public Member Functions

ConfigBuilder< C > add (C config)
 Adds a new configuration instance (build phase).
 
build ()
 Builds the result configuration stack and returns a configuration instance representing it.
 

Member Function Documentation

◆ add()

Adds a new configuration instance (build phase).

A builder forms a Java list type stack of configurations based on the order of adding them: the first one added is the first source used when looking up a configuration value.

Parameters
configThe configuration instance to add.
Returns
This builder instance.

◆ build()

Builds the result configuration stack and returns a configuration instance representing it.

Returns
Configuration instance representing the stack (structure is closest equivalent to a Java list). Getting values from the resulting configuration must prefer values by order of added configuration instances. In other words, the stack must implement fallback behavior.

The documentation for this interface was generated from the following file: