Package io.confound.config.properties
Class PropertiesConfiguration
- java.lang.Object
-
- io.confound.config.AbstractConfiguration
-
- io.confound.config.BaseConfiguration<java.lang.String>
-
- io.confound.config.AbstractStringConfiguration
-
- io.confound.config.properties.PropertiesConfiguration
-
- All Implemented Interfaces:
io.confound.config.Configuration
,io.confound.config.Parameters
public class PropertiesConfiguration extends io.confound.config.AbstractStringConfiguration
Configuration implementation backed byProperties
.- Author:
- Garret Wilson
- See Also:
Properties
,Properties.getProperty(String)
-
-
Constructor Summary
Constructors Constructor Description PropertiesConfiguration(java.util.Properties properties)
Properties constructor.PropertiesConfiguration(java.util.Properties properties, io.confound.config.Configuration parentConfiguration)
Parent configuration and properties constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Optional<java.lang.String>
findParameterImpl(java.lang.String key)
This implementation delegates toProperties.getProperty(String)
.protected boolean
hasParameterImpl(java.lang.String key)
This implementation delegates toProperties.contains(Object)
.-
Methods inherited from class io.confound.config.AbstractStringConfiguration
dereferenceString, findParameter, getOptionalBoolean, getOptionalDouble, getOptionalInt, getOptionalLong, getOptionalPath, getOptionalString, getOptionalUri
-
Methods inherited from class io.confound.config.BaseConfiguration
getOptionalParameter, hasParameter, normalizeKey
-
-
-
-
Constructor Detail
-
PropertiesConfiguration
public PropertiesConfiguration(@Nonnull java.util.Properties properties)
Properties constructor.- Parameters:
properties
- The properties to back this configuration.- Throws:
java.lang.NullPointerException
- if the given properties isnull
.
-
PropertiesConfiguration
public PropertiesConfiguration(@Nonnull java.util.Properties properties, @Nullable io.confound.config.Configuration parentConfiguration)
Parent configuration and properties constructor.- Parameters:
properties
- The properties to back this configuration.parentConfiguration
- The parent configuration to use for fallback lookup, ornull
if there is no parent configuration.- Throws:
java.lang.NullPointerException
- if the given properties isnull
.
-
-
Method Detail
-
hasParameterImpl
protected boolean hasParameterImpl(java.lang.String key) throws io.confound.config.ConfigurationException
This implementation delegates toProperties.contains(Object)
.- Overrides:
hasParameterImpl
in classio.confound.config.BaseConfiguration<java.lang.String>
- Throws:
io.confound.config.ConfigurationException
-
findParameterImpl
protected java.util.Optional<java.lang.String> findParameterImpl(java.lang.String key) throws io.confound.config.ConfigurationException
This implementation delegates toProperties.getProperty(String)
.- Specified by:
findParameterImpl
in classio.confound.config.BaseConfiguration<java.lang.String>
- Throws:
io.confound.config.ConfigurationException
-
-