Interface PropertySource
-
public interface PropertySourceManages a source of property-like values.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfacePropertySource.EditorProvides a means to update the underlying store in a thread-safe manner.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PropertySource.EditorgetEditor()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.StringgetValue(String key, String defaultValue)Returns the value of the specified key.voidreloadIfUpdated()Reloads the properties from the source if they have been changed since the last load.
-
-
-
Method Detail
-
reloadIfUpdated
void reloadIfUpdated()
Reloads the properties from the source if they have been changed since the last load.
-
getKeysStartingWith
Set<String> getKeysStartingWith(String prefix)
Returns the keys from the source that start with the specified prefix.- Parameters:
prefix- the prefix to find- Returns:
- the keys starting with the specified prefix; an empty collection if no keys are found
-
getValue
String getValue(String key, String defaultValue)
Returns the value of the specified key. If the key is not found the specified default value is returned.- Parameters:
key- the keydefaultValue- the default value if the key is not found- Returns:
- the value for the key
-
getEditor
PropertySource.Editor getEditor()
Returns a class suitable for editing the properties in the underlying representation in a thread-safe manner.- Returns:
- an editor instance
- Throws:
UnsupportedOperationException- if this property source does not support updates
-
-