Interface PropertySource


public interface PropertySource
Manages a source of property-like values.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Provides a means to update the underlying store in a thread-safe manner.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a class suitable for editing the properties in the underlying representation in a thread-safe manner.
    Returns the keys from the source that start with the specified prefix.
    getValue(String key, String defaultValue)
    Returns the value of the specified key.
    void
    Reloads 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

      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 key
      defaultValue - the default value if the key is not found
      Returns:
      the value for the key
    • 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