public final class ConfigurationSourcesModuleBuilder extends Object
ConfigurationSource
s.
The Guice module that is built by this builder configures
Multibinder
for ConfigurationSource
This builder can be used in multiple modules to bind multiple ConfigurationSource
.
Consumer must use the addSource(ConfigurationSource)
builder method to build the list of configuration Sources.
The build()
method creates a new anonymous
Module
that configures a Multibinder
for the provided ConfigurationSource
Usage:
public class MyModule extends AbstractModule {
@Override
protected void configure() {
install(ConfigurationSourcesModuleBuilder.newBuilder()
.addSource(source1)
.addSource(source2)
.addSource(source3)
.build());
}
}
It is the responsibility of the consumer to build the configuration sources with appropriate
priority (natural ordering). The priority or natural ordering of the ConfigurationSource
s
is what is considered when loading the configurations from the corresponding sources instead of
the order in which they are configured using this Builder.
BeadledomConfigurationModule
Modifier and Type | Method and Description |
---|---|
ConfigurationSourcesModuleBuilder |
addSource(ConfigurationSource configurationSource)
Adds the given
configurationSource to the list. |
com.google.inject.Module |
build()
Builds the
ConfigurationSourcesModuleBuilder with the list of
ConfigurationSource s built using the #addSource(ConfigurationSource) builder method. |
static ConfigurationSourcesModuleBuilder |
newBuilder()
Static Convenience method create an instance of
ConfigurationSourcesModuleBuilder . |
public static ConfigurationSourcesModuleBuilder newBuilder()
ConfigurationSourcesModuleBuilder
.public ConfigurationSourcesModuleBuilder addSource(ConfigurationSource configurationSource)
configurationSource
to the list.configurationSource
- configuration source from which Configuration will be built.ConfigurationSourcesModuleBuilder
.public com.google.inject.Module build()
ConfigurationSourcesModuleBuilder
with the list of
ConfigurationSource
s built using the #addSource(ConfigurationSource)
builder method.Copyright © 2020 Cerner Innovation, Inc.. All rights reserved.