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.ConfigSourceExtends the originalConfigSourceto expose methods that return aConfigValue. TheConfigValueallows retrieving additional metadata associated with the configuration resolution.This works around the MicroProfile Config
ConfigSourcelimitations, which exposes everything as plain Strings, and retrieving additional information associated with the Configuration is impossible. TheConfigValueConfigSourcetries to make this possible.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classConfigValueConfigSource.ConfigValueMapStringViewTheConfigValueConfigSource.ConfigValueMapStringViewis a view over a Map of String configs names and String values.static classConfigValueConfigSource.ConfigValueMapViewTheConfigValueConfigSource.ConfigValueMapViewis a view over a Map of String configs names andConfigValuevalues.static classConfigValueConfigSource.ConfigValuePropertiesLoads properties asConfigValue.
-
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 viaConfigValueConfigSource.ConfigValueMapView.- 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
-
-