public class PropertiesPropertySource extends Object implements PropertySource
PropertySource
implementation for use with Properties
.PropertySource.Editor
Constructor and Description |
---|
PropertiesPropertySource(Properties properties) |
Modifier and Type | Method and Description |
---|---|
PropertySource.Editor |
getEditor()
Returns a class suitable for editing the properties in the underlying representation in a
thread-safe manner.
|
Set<String> |
getKeysStartingWith(String prefix)
Returns the keys from the source that start with the specified prefix.
|
String |
getValue(String key,
String defaultValue)
Returns the value of the specified key.
|
void |
reloadIfUpdated()
Reloads the properties from the source if they have been changed since the last load.
|
public PropertiesPropertySource(Properties properties)
public void reloadIfUpdated()
PropertySource
reloadIfUpdated
in interface PropertySource
public Set<String> getKeysStartingWith(String prefix)
PropertySource
getKeysStartingWith
in interface PropertySource
prefix
- the prefix to findpublic String getValue(String key, String defaultValue)
PropertySource
getValue
in interface PropertySource
key
- the keydefaultValue
- the default value if the key is not foundpublic PropertySource.Editor getEditor()
PropertySource
getEditor
in interface PropertySource
Copyright © 2017. All Rights Reserved.