Package io.smallrye.config
Interface ConfigValueConfigSource
-
- All Superinterfaces:
org.eclipse.microprofile.config.spi.ConfigSource
- All Known Implementing Classes:
ConfigValuePropertiesConfigSource,MapBackedConfigValueConfigSource
@Experimental("Extension to the original ConfigSource to allow retrieval of additional metadata on config lookup") public interface ConfigValueConfigSource extends org.eclipse.microprofile.config.spi.ConfigSourceExtends the originalConfigSourceto expose methods that return aConfigValue. TheConfigValueallows to retrieve additional metadata associated with the configuration resolution.This is to work around the limitation from the original
ConfigSource. It exposes everything as plain Strings and it is not possible to retrieve additional information associated with the Configuration. The ConfigValueConfigSource tries to make this possible.Ideally, this should move the MicroProfile Config API, once the concept is well-proven.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ConfigValuegetConfigValue(String propertyName)Return theConfigValuefor the specified property in this configuration source.Map<String,ConfigValue>getConfigValueProperties()Return the properties in this configuration source as a Map of String andConfigValue.default Map<String,String>getProperties()Return the properties in this configuration source as a map.default StringgetValue(String propertyName)Return the value for the specified property in this configuration source.
-
-
-
Method Detail
-
getConfigValue
ConfigValue getConfigValue(String propertyName)
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
default Map<String,String> 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 viaConfigValueMapView.- Specified by:
getPropertiesin interfaceorg.eclipse.microprofile.config.spi.ConfigSource- Returns:
- a map containing properties of this configuration source
-
getValue
default String getValue(String propertyName)
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
-
-