Package io.confound.config
Class StringMapConfiguration
java.lang.Object
io.confound.config.AbstractConfiguration
io.confound.config.BaseConfiguration<String>
io.confound.config.AbstractStringConfiguration
io.confound.config.StringMapConfiguration
- All Implemented Interfaces:
Configuration
Configuration implementation backed by a
Map
with string values.- Author:
- Garret Wilson
- See Also:
-
Field Summary
Fields inherited from interface io.confound.config.Configuration
KEY_SEGMENT_SEPARATOR, KEY_SEGMENTS_PATTERN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionImplementation to retrieves a general configuration value that may not be present from the underlying storage.findSection
(String key) Retrieves a section that may not be present.protected boolean
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, findCollection, 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, findCollection, findObject, getBoolean, getCollection, getCollection, getDouble, getInt, getLong, getObject, getObject, getPath, getSection, getString, getUri, requireConfiguration, resolvePath, subConfiguration, superConfiguration, withFallback
-
Constructor Details
-
StringMapConfiguration
Map constructor.- Parameters:
map
- The map to back this configuration.- Throws:
NullPointerException
- if the given map isnull
.
-
-
Method Details
-
findSection
Retrieves a section that may not be present.- Implementation Specification:
- This implementation always returns
Optional.empty()
, as string maps do not support sections. - Parameters:
key
- The configuration key.- Returns:
- The optional section associated with the given key.
- Throws:
ConfigurationException
- if there is a configuration value stored in an invalid format.
-
hasConfigurationValueImpl
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<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
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<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.
-