Class AbstractWatchableConfig

All Implemented Interfaces:
Config, MutableConfig, WatchableConfig
Direct Known Subclasses:
CommonsMutableConfigImpl, JsonMutableConfigImpl, PreferencesMutableConfigImpl, PropertiesMutableConfigImpl, XmlMutableConfigImpl

@API(status=INTERNAL, since="1.0") public abstract class AbstractWatchableConfig extends AbstractMutableConfig implements WatchableConfig
Base abstract implementation of watchable mutable configuration properties provider.
Since:
1.0
Version:
1.0, 2025-04
Author:
(w) Iker Hernaez
  • Constructor Details

    • AbstractWatchableConfig

      protected AbstractWatchableConfig(@NotNull @NotNull ConfigOptions options, @NotNull @NotNull MutableConfigOptions mutableOptions)
      Creates a new instance.
      Parameters:
      options - The configuration builder options.
      mutableOptions - The mutable configuration builder options.
  • Method Details

    • getEvents

      protected EventsHandler getEvents()
      Returns the configuration change events handler, if supported by delegated configuration.
      Returns:
      The configuration change events handler.
    • set

      public void set(@NotBlank @NotBlank String key, String value)
      Sets the value of the specified configuration property.
      Specified by:
      set in interface MutableConfig
      Overrides:
      set in class AbstractMutableConfig
      Parameters:
      key - The configuration property.
      value - The value to set
    • remove

      public void remove(@NotBlank @NotBlank String... keys)
      Removes the specified configuration properties.
      Specified by:
      remove in interface MutableConfig
      Overrides:
      remove in class AbstractMutableConfig
      Parameters:
      keys - The configuration properties.
    • addListener

      public void addListener(@NotNull @NotNull WatchableConfig.Listener listener)
      Registers the specified configuration change events listener.
      Specified by:
      addListener in interface WatchableConfig
      Parameters:
      listener - The listener to be called on configuration changes.
    • removeListener

      public void removeListener(@NotNull @NotNull WatchableConfig.Listener listener)
      Unregisters the specified configuration change events listener.
      Specified by:
      removeListener in interface WatchableConfig
      Parameters:
      listener - The listener to previously registered.
    • notifyLocalChanges

      protected void notifyLocalChanges(@NotNull @NotNull String... keys)
      Notifies configuration properties changed through this instance to all registered listeners.
      Parameters:
      keys - The changed local properties.
    • notifyParentChanges

      protected void notifyParentChanges(@NotNull @NotNull Set<String> keys)
      Notifies configuration properties changed through parent configuration to all registered listeners.
      Parameters:
      keys - The changed parent properties.