Class SettingStore


  • public abstract class SettingStore
    extends Object
    Manages persistence of Setting.
    Since:
    2.0.0
    See Also:
    Settings
    • Constructor Detail

      • SettingStore

        public SettingStore()
    • Method Detail

      • setInstance

        public static void setInstance​(SettingStore store)
        Replaces the current store instance with the given one.
        Parameters:
        store - the new store.
      • setValue

        protected abstract void setValue​(String key,
                                         String value,
                                         Optional<String> scope)
                                  throws SettingStoreException
        Adds a setting. If the setting key already exists, the value is updated.
        Parameters:
        key - the setting key
        value - the setting value
        scope - the scope identifier
        Throws:
        SettingStoreException - if an error occurs while querying the store
      • delete

        protected abstract void delete​(String key,
                                       Optional<String> scope)
                                throws SettingStoreException
        Deletes a setting. If the setting does not exists, nothing is done and no error is thrown.
        Parameters:
        key - the setting key
        scope - the scope identifier
        Throws:
        SettingStoreException - if an error occurs while querying the store