public interface ConfigurationProperty<T>
Modifier and Type | Method and Description |
---|---|
static KeyContext |
forKey(String key)
Start the creation of a configuration property.
|
T |
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.
|
Optional<String> |
resolve(ConfigurationPropertySource source)
Resolve the key for this configuration property
as registered in the underlying configuration source,
if possible.
|
String |
resolveOrRaw(ConfigurationPropertySource source)
Resolve the key for this configuration property
as registered in the underlying configuration source,
or, if not possible, just return the "raw" key passed to
forKey(String) . |
T get(ConfigurationPropertySource source)
source
- A configuration source.<R> R getAndTransform(ConfigurationPropertySource source, Function<T,R> transform)
Any exception occurring during transformation will be wrapped in another exception adding some context,
such as the resolved key
for this property.
source
- A configuration source.transform
- A transform function to be applied to the value of this configuration property
before returning the result.Optional<String> resolve(ConfigurationPropertySource source)
Useful for error messages addressed to the user.
source
- A configuration source.ConfigurationPropertySource.resolve(String)
String resolveOrRaw(ConfigurationPropertySource source)
forKey(String)
.
Useful for debugging.
source
- A configuration source.resolve(ConfigurationPropertySource)
static KeyContext forKey(String key)
key
- The key for that configuration property.Copyright © 2006-2019 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.