Interface PropertySource
public interface PropertySource
Manages a source of property-like values.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceProvides a means to update the underlying store in a thread-safe manner. -
Method Summary
Modifier and TypeMethodDescriptionReturns a class suitable for editing the properties in the underlying representation in a thread-safe manner.getKeysStartingWith(String prefix) Returns the keys from the source that start with the specified prefix.Returns the value of the specified key.voidReloads the properties from the source if they have been changed since the last load.
-
Method Details
-
reloadIfUpdated
void reloadIfUpdated()Reloads the properties from the source if they have been changed since the last load. -
getKeysStartingWith
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
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
-