Package io.smallrye.config
Interface ConfigValueConfigSource
- All Superinterfaces:
org.eclipse.microprofile.config.spi.ConfigSource
- All Known Implementing Classes:
MapBackedConfigValueConfigSource,PropertiesConfigSource
public interface ConfigValueConfigSource
extends org.eclipse.microprofile.config.spi.ConfigSource
Extends the original
ConfigSource to expose methods that return a ConfigValue. The
ConfigValue allows retrieving additional metadata associated with the configuration resolution.
This works around the MicroProfile Config ConfigSource limitations, which exposes everything as plain
Strings, and retrieving additional information associated with the Configuration is impossible. The
ConfigValueConfigSource tries to make this possible.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classTheConfigValueConfigSource.ConfigValueMapStringViewis a view over a Map of String configs names and String values.static final classTheConfigValueConfigSource.ConfigValueMapViewis a view over a Map of String configs names andConfigValuevalues.static final classLoads properties asConfigValue. -
Field Summary
Fields inherited from interface org.eclipse.microprofile.config.spi.ConfigSource
CONFIG_ORDINAL, DEFAULT_ORDINAL -
Method Summary
Modifier and TypeMethodDescriptiongetConfigValue(String propertyName) Return theConfigValuefor the specified property in this configuration source.Return the properties in this configuration source as a Map of String andConfigValue.Return the properties in this configuration source as a map.default StringReturn the value for the specified property in this configuration source.Methods inherited from interface org.eclipse.microprofile.config.spi.ConfigSource
getName, getOrdinal, getPropertyNames
-
Method Details
-
getConfigValue
Return theConfigValuefor the specified property in this configuration source.- Parameters:
propertyName- the property name- Returns:
- the ConfigValue, or
nullif the property is not present
-
getConfigValueProperties
Map<String,ConfigValue> getConfigValueProperties()Return the properties in this configuration source as a Map of String andConfigValue.- Returns:
- a map containing properties of this configuration source
-
getProperties
Return the properties in this configuration source as a map.This wraps the original
ConfigValuemap returned bygetConfigValueProperties()and provides a view over the original map viaConfigValueConfigSource.ConfigValueMapView.- Specified by:
getPropertiesin interfaceorg.eclipse.microprofile.config.spi.ConfigSource- Returns:
- a map containing properties of this configuration source
-
getValue
Return the value for the specified property in this configuration source.This wraps the original
ConfigValuereturned bygetConfigValue(String)and unwraps the property value containedConfigValue. If theConfigValueis null the unwrapped value and return is also null.- Specified by:
getValuein interfaceorg.eclipse.microprofile.config.spi.ConfigSource- Parameters:
propertyName- the property name- Returns:
- the property value, or
nullif the property is not present
-