Package org.somda.sdc.common.guice
Class AbstractConfigurationModule
-
- All Implemented Interfaces:
-
com.google.inject.Module
public abstract class AbstractConfigurationModule extends AbstractModuleUtility class for other modules to allow app configuration via Google Guice.
Derive any concrete configuration module in order to override default values. Use bind to set values.
-
-
Constructor Summary
Constructors Constructor Description AbstractConfigurationModule()
-
Method Summary
-
-
Method Detail
-
bind
<T> void bind(String name, Class<T> dataType, @Nullable() T value)
Binds a configuration key to a value from outside.
This operation can only be performed once per key. All unpopulated keys are supposed to be filled with a default value once configure is called by Guice.
- Parameters:
name- the configuration key.dataType- the data type bound by the key (should be defined in configuration class).value- the configuration value to set.
-
bind
<T> void bind(String name, TypeLiteral<T> typeLiteral, @Nullable() T value)
Binds a configuration key to a value from outside.
This operation can only be performed once per key. All unpopulated keys are supposed to be filled with a default value once configure is called by Guice.
- Parameters:
name- the configuration key.typeLiteral- the data type bound by the key (should be defined in configuration class).value- the configuration value to set.
-
-
-
-