public class CompositeConfigurationProvider extends java.lang.Object implements ConfigurationProvider
has(ConfigurationKey) is used
to return the configuration.| Constructor and Description |
|---|
CompositeConfigurationProvider(java.util.Collection<ConfigurationProvider> providers) |
CompositeConfigurationProvider(ConfigurationProvider... providers) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(ConfigurationProvider configurationProvider) |
com.google.common.base.Supplier<java.lang.Boolean> |
getBooleanSupplier(ConfigurationKey key,
java.lang.Boolean defaultValue)
Return the given configuration as a boolean.
|
com.google.common.base.Supplier<java.util.Date> |
getDateSupplier(ConfigurationKey key,
java.util.Date defaultValue)
Return the given configuration as a date.
|
com.google.common.base.Supplier<java.lang.Double> |
getDoubleSupplier(ConfigurationKey key,
java.lang.Double defaultValue)
Return the given configuration as a double.
|
com.google.common.base.Supplier<java.lang.Integer> |
getIntegerSupplier(ConfigurationKey key,
java.lang.Integer defaultValue)
Return the given configuration as an integer.
|
com.google.common.base.Supplier<java.lang.Long> |
getLongSupplier(ConfigurationKey key,
java.lang.Long defaultValue)
Return the given configuration as a long.
|
<T> com.google.common.base.Supplier<T> |
getObjectSupplier(ConfigurationKey key,
T defaultValue,
java.lang.Class<T> objectType)
Return the given configuration as an object of the given type.
|
com.google.common.base.Supplier<java.lang.String> |
getStringSupplier(ConfigurationKey key,
java.lang.String defaultValue)
Return the given configuration as a string.
|
boolean |
has(ConfigurationKey key)
Return true if there is a configuration value set for the given key
|
public CompositeConfigurationProvider(ConfigurationProvider... providers)
providers - ordered providerspublic CompositeConfigurationProvider(java.util.Collection<ConfigurationProvider> providers)
providers - ordered providerspublic void add(ConfigurationProvider configurationProvider)
public boolean has(ConfigurationKey key)
ConfigurationProviderhas in interface ConfigurationProviderkey - configuration keypublic com.google.common.base.Supplier<java.lang.Boolean> getBooleanSupplier(ConfigurationKey key, java.lang.Boolean defaultValue)
ConfigurationProvidergetBooleanSupplier in interface ConfigurationProviderkey - configuration keypublic com.google.common.base.Supplier<java.lang.Integer> getIntegerSupplier(ConfigurationKey key, java.lang.Integer defaultValue)
ConfigurationProvidergetIntegerSupplier in interface ConfigurationProviderkey - configuration keypublic com.google.common.base.Supplier<java.lang.Long> getLongSupplier(ConfigurationKey key, java.lang.Long defaultValue)
ConfigurationProvidergetLongSupplier in interface ConfigurationProviderkey - configuration keypublic com.google.common.base.Supplier<java.lang.Double> getDoubleSupplier(ConfigurationKey key, java.lang.Double defaultValue)
ConfigurationProvidergetDoubleSupplier in interface ConfigurationProviderkey - configuration keypublic com.google.common.base.Supplier<java.lang.String> getStringSupplier(ConfigurationKey key, java.lang.String defaultValue)
ConfigurationProvidergetStringSupplier in interface ConfigurationProviderkey - configuration keypublic com.google.common.base.Supplier<java.util.Date> getDateSupplier(ConfigurationKey key, java.util.Date defaultValue)
ConfigurationProvidergetDateSupplier in interface ConfigurationProviderkey - configuration keypublic <T> com.google.common.base.Supplier<T> getObjectSupplier(ConfigurationKey key, T defaultValue, java.lang.Class<T> objectType)
ConfigurationProvidergetObjectSupplier in interface ConfigurationProviderT - type of the configuration to returnkey - configuration keydefaultValue - value to return when key is not foundobjectType - Class of the configuration to return