Package io.confound.config
Class StringMapConfiguration
- java.lang.Object
-
- io.confound.config.AbstractConfiguration
-
- io.confound.config.BaseConfiguration<java.lang.String>
-
- io.confound.config.AbstractStringConfiguration
-
- io.confound.config.StringMapConfiguration
-
- All Implemented Interfaces:
Configuration
public class StringMapConfiguration extends AbstractStringConfiguration
Configuration implementation backed by aMap
with string values.- Author:
- Garret Wilson
- See Also:
Map
,Map.get(Object)
-
-
Field Summary
-
Fields inherited from interface io.confound.config.Configuration
KEY_SEGMENT_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description StringMapConfiguration(java.util.Map<java.lang.String,java.lang.String> map)
Map constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Optional<java.lang.String>
findConfigurationValueImpl(java.lang.String key)
Implementation to retrieves a general configuration value that may not be present from the underlying storage.protected boolean
hasConfigurationValueImpl(java.lang.String key)
Determines whether a configuration value is present in the underlying storage.-
Methods inherited from class io.confound.config.AbstractStringConfiguration
dereferenceString, findBoolean, findConfigurationValue, findDouble, findInt, findLong, findObject, findPath, findString, findUri
-
Methods inherited from class io.confound.config.BaseConfiguration
convertValue, hasConfigurationValue, normalizeKey
-
Methods inherited from class io.confound.config.AbstractConfiguration
or
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.confound.config.Configuration
createMissingConfigurationKeyException, findObject, getBoolean, getDouble, getInt, getLong, getObject, getObject, getPath, getString, getUri, requireConfiguration, resolvePath, subConfiguration, superConfiguration, withFallback
-
-
-
-
Method Detail
-
hasConfigurationValueImpl
protected boolean hasConfigurationValueImpl(java.lang.String key) throws ConfigurationException
Determines whether a configuration value is present in the underlying storage.The given configuration key is assumed to already be normalized, and should not be modified.
This method must not fall back to parent configuration; only local values must be returned.
- Overrides:
hasConfigurationValueImpl
in classBaseConfiguration<java.lang.String>
- Implementation Specification:
- This implementation delegates to
Map.containsKey(Object)
. - Parameters:
key
- The normalized configuration key.- Returns:
true
if a value of any type could be retrieved from this configuration using the given key.- Throws:
ConfigurationException
- if there is a configuration value stored in an invalid format.
-
findConfigurationValueImpl
protected java.util.Optional<java.lang.String> findConfigurationValueImpl(java.lang.String key) throws ConfigurationException
Implementation to retrieves a general configuration value that may not be present from the underlying storage.The given configuration key is assumed to already be normalized, and should not be modified.
This method must not fall back to parent configuration; only local values must be returned.
- Specified by:
findConfigurationValueImpl
in classBaseConfiguration<java.lang.String>
- Implementation Specification:
- This implementation delegates to
Map.get(Object)
. - Parameters:
key
- The normalized configuration key.- Returns:
- The optional configuration value associated with the given key.
- Throws:
ConfigurationException
- if there is a configuration value stored in an invalid format.
-
-