10Duke Java Core
|
Interface to implement for assembling configurations from multiple data sources.
The builder defines two stages:
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.
<C> | Type of configuration. |
Public Member Functions | |
ConfigBuilder< C > | add (C config) |
Adds a new configuration instance (build phase). | |
C | build () |
Builds the result configuration stack and returns a configuration instance representing it. | |
ConfigBuilder< C > tenduke.sdk.core.model.config.ConfigBuilder< C extends Configuration >.add | ( | C | config | ) |
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.
config | The configuration instance to add. |
C tenduke.sdk.core.model.config.ConfigBuilder< C extends Configuration >.build | ( | ) |
Builds the result configuration stack and returns a configuration instance representing it.