Interface ConfigurationProperty<T>
- All Known Subinterfaces:
OptionalConfigurationProperty<T>
public interface ConfigurationProperty<T>
-
Method Summary
Modifier and TypeMethodDescriptionstatic KeyContext
Start the creation of a configuration property.get
(ConfigurationPropertySource source) Get the value of this configuration property.<R> R
getAndTransform
(ConfigurationPropertySource source, Function<T, R> transform) Get and transform the value of this configuration property.resolve
(ConfigurationPropertySource source) Resolve the key for this configuration property as registered in the underlying configuration source, if possible.Resolve the key for this configuration property as registered in the underlying configuration source, or, if not possible, just return the "raw" key passed toforKey(String)
.
-
Method Details
-
get
Get the value of this configuration property.- Parameters:
source
- A configuration source.- Returns:
- The value of this property according to the given source.
-
getAndTransform
Get and transform the value of this configuration property.Any exception occurring during transformation will be wrapped in another exception adding some context, such as the
resolved key
for this property.- Type Parameters:
R
- The transformed type.- Parameters:
source
- A configuration source.transform
- A transform function to be applied to the value of this configuration property before returning the result.- Returns:
- The value of this property according to the given source.
-
resolve
Resolve the key for this configuration property as registered in the underlying configuration source, if possible.Useful for error messages addressed to the user.
- Parameters:
source
- A configuration source.- Returns:
- The value of this property according to the given source.
- See Also:
-
resolveOrRaw
Resolve the key for this configuration property as registered in the underlying configuration source, or, if not possible, just return the "raw" key passed toforKey(String)
.Useful for debugging.
- Parameters:
source
- A configuration source.- Returns:
- The value of this property according to the given source.
- See Also:
-
forKey
Start the creation of a configuration property.- Parameters:
key
- The key for that configuration property.- Returns:
- A context allowing to further define the configuration property.
-