- java.lang.Object
-
- io.helidon.config.ConfigSourceRuntimeImpl
-
- All Implemented Interfaces:
ConfigSourceRuntime,org.eclipse.microprofile.config.spi.ConfigSource
public class ConfigSourceRuntimeImpl extends Object implements org.eclipse.microprofile.config.spi.ConfigSource
The runtime of a config source. For a singleConfig, there is one source runtime for each configured config source.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.microprofile.config.spi.ConfigSourceasMpSource()Get the underlying config source as a MicroProfileConfigSource.Stringdescription()Description of the underlying config source.booleanequals(Object o)StringgetName()Map<String,String>getProperties()StringgetValue(String propertyName)inthashCode()booleanisLazy()If a config source is lazy, itsConfigSourceRuntime.load()method always returns empty and you must useConfigSourceRuntime.node(String)methods to retrieve its values.Optional<ConfigNode.ObjectNode>load()Load the config source if it is eager (such asParsableSourceorNodeConfigSource.Optional<ConfigNode>node(String key)Get a single config node based on the key.voidonChange(BiConsumer<String,ConfigNode> change)Change support for a runtime.StringtoString()
-
-
-
Method Detail
-
onChange
public void onChange(BiConsumer<String,ConfigNode> change)
Description copied from interface:ConfigSourceRuntimeChange support for a runtime.- Specified by:
onChangein interfaceConfigSourceRuntime- Parameters:
change- change listener
-
load
public Optional<ConfigNode.ObjectNode> load()
Description copied from interface:ConfigSourceRuntimeLoad the config source if it is eager (such asParsableSourceorNodeConfigSource.For
LazyConfigSource, this method may return an empty optional (if no key was yet requested), or a node with currently known keys and values.- Specified by:
loadin interfaceConfigSourceRuntime- Returns:
- loaded data
-
isLazy
public boolean isLazy()
Description copied from interface:ConfigSourceRuntimeIf a config source is lazy, itsConfigSourceRuntime.load()method always returns empty and you must useConfigSourceRuntime.node(String)methods to retrieve its values.- Specified by:
isLazyin interfaceConfigSourceRuntime- Returns:
trueif the underlying config source cannot load whole configuration tree
-
node
public Optional<ConfigNode> node(String key)
Description copied from interface:ConfigSourceRuntimeGet a single config node based on the key. Use this method if you are interested in a specific key, as it works both for eager and lazy config sources.- Specified by:
nodein interfaceConfigSourceRuntime- Parameters:
key- key of the node to retrieve- Returns:
- value on the key, or empty if not present
-
asMpSource
public org.eclipse.microprofile.config.spi.ConfigSource asMpSource()
Description copied from interface:ConfigSourceRuntimeGet the underlying config source as a MicroProfileConfigSource.- Specified by:
asMpSourcein interfaceConfigSourceRuntime- Returns:
- MP Config source
-
description
public String description()
Description copied from interface:ConfigSourceRuntimeDescription of the underlying config source.- Specified by:
descriptionin interfaceConfigSourceRuntime- Returns:
- description of the source
-
getProperties
public Map<String,String> getProperties()
- Specified by:
getPropertiesin interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
getValue
public String getValue(String propertyName)
- Specified by:
getValuein interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
getName
public String getName()
- Specified by:
getNamein interfaceorg.eclipse.microprofile.config.spi.ConfigSource
-
-