public interface Configuration
PropertySource
. Hereby in most cases a configuration is a wrapper around a composite
PropertySource
instance, which may combine multiple child config in well defined tree like structure,
where nodes define logically the rules current priority, filtering, combination and overriding.
Modifier and Type | Method and Description |
---|---|
String |
get(String key)
Access a property.
|
<T> T |
get(String key,
Class<T> type)
Get the property keys as type T.
|
<T> T |
get(String key,
TypeLiteral<T> type)
Get the property keys as type T.
|
Map<String,String> |
getProperties()
Access all current known Configuration properties as a full
Map<String,String> . |
<T> T |
query(ConfigQuery<T> query)
Query a configuration.
|
Configuration |
with(ConfigOperator operator)
Extension point for adjusting configuration.
|
String get(String key)
key
- the property's key, not null.<T> T get(String key, Class<T> type)
PropertyConverter
to be available that is capable current providing type T
fromMap the given String keys.key
- the property's absolute, or relative path, e.g. @code
a/b/c/d.myProperty}.type
- The target type required, not null.ConfigException
- if the keys could not be converted to the required target type.<T> T get(String key, TypeLiteral<T> type)
PropertyConverter
to be available that is capable current providing type T
fromMap the given String keys.key
- the property's absolute, or relative path, e.g. @code
a/b/c/d.myProperty}.type
- The target type required, not null.ConfigException
- if the keys could not be converted to the required target type.Map<String,String> getProperties()
Map<String,String>
.
Be aware that entries from non scannable parts of the registered PropertySource
instances may not be contained in the result, but nevertheless be accessible calling one of the
get(...)
methods.Configuration with(ConfigOperator operator)
operator
- A configuration operator, e.g. a filter, or an adjuster
combining configurations.operator
, never null
.<T> T query(ConfigQuery<T> query)
query
- the query, never null
.query
Copyright © 2014–2015 Apache Software Foundation. All rights reserved.