@Role public interface ConfigurationSource
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(String key) |
List<String> |
getKeys() |
<T> T |
getProperty(String key) |
<T> T |
getProperty(String key,
Class<T> valueClass) |
default <T> T |
getProperty(String key,
Class<T> valueClass,
T defaultValue) |
<T> T |
getProperty(String key,
T defaultValue) |
boolean |
isEmpty() |
default void |
setProperties(Map<String,Object> properties) |
<T> T getProperty(String key, T defaultValue)
T
- the value typekey
- the property key for which we want the valuedefaultValue
- the value to use if the key isn't found<T> T getProperty(String key, Class<T> valueClass)
T
- the value typekey
- the property key for which we want the valuevalueClass
- the type of object that should be returned. The value is converted to the passed type.@Unstable default <T> T getProperty(String key, Class<T> valueClass, T defaultValue)
T
- the value typekey
- the property key for which we want the valuevalueClass
- the type of object that should be returned. The value is converted to the passed type.defaultValue
- the value to use if the key isn't found<T> T getProperty(String key)
T
- the value typekey
- the property key for which we want the valuegetProperty(String, Class)
or getProperty(String, Object)
boolean containsKey(String key)
key
- the key to checkboolean isEmpty()
@Unstable default void setProperties(Map<String,Object> properties) throws ConfigurationSaveException
properties
- the set of properties to persistConfigurationSaveException
- when an error occurs during persistenceCopyright © 2004–2021 XWiki. All rights reserved.