@Experimental(value="Extension to the original ConfigSource to allow retrieval of additional metadata on config lookup")
public interface ConfigValueConfigSource
extends org.eclipse.microprofile.config.spi.ConfigSource
ConfigSource to expose methods that return a ConfigValue. The
ConfigValue allows 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 the MicroProfile Config API, once the concept is well-proven.
| Modifier and Type | Method and Description |
|---|---|
ConfigValue |
getConfigValue(String propertyName)
Return the
ConfigValue for the specified property in this configuration source. |
Map<String,ConfigValue> |
getConfigValueProperties()
Return the properties in this configuration source as a Map of String and
ConfigValue. |
default Map<String,String> |
getProperties()
Return the properties in this configuration source as a map.
|
default String |
getValue(String propertyName)
Return the value for the specified property in this configuration source.
|
ConfigValue getConfigValue(String propertyName)
ConfigValue for the specified property in this configuration source.propertyName - the property namenull if the property is not presentMap<String,ConfigValue> getConfigValueProperties()
ConfigValue.default Map<String,String> getProperties()
This wraps the original ConfigValue map returned by
getConfigValueProperties() and provides a view over the original map
via ConfigValueMapView.
getProperties in interface org.eclipse.microprofile.config.spi.ConfigSourcedefault String getValue(String propertyName)
This wraps the original ConfigValue returned by getConfigValue(String)
and unwraps the property value contained ConfigValue. If the ConfigValue is null the unwrapped
value and return is also null.
getValue in interface org.eclipse.microprofile.config.spi.ConfigSourcepropertyName - the property namenull if the property is not presentCopyright © 2018–2020. All rights reserved.