Class DelegatedWatchableConfig

All Implemented Interfaces:
Config, MutableConfig, WatchableConfig

@API(status=STABLE, since="1.0") public class DelegatedWatchableConfig extends DelegatedMutableConfig implements WatchableConfig
A watchable mutable configuration that delegates all operations to another configuration. This class is useful for creating a proxy or wrapper around an existing configuration instance, allowing for additional behavior or modifications without changing the original configuration.
Since:
1.0
Version:
1.0, 2025-08
Author:
(w) Iker Hernaez
  • Constructor Details

    • DelegatedWatchableConfig

      public DelegatedWatchableConfig(@NotNull @NotNull WatchableConfig delegate)
      Creates a new instance.
      Parameters:
      delegate - The configuration to delegate to.
  • Method Details

    • getDelegate

      @NotNull protected @NotNull WatchableConfig getDelegate()
      Returns the delegate configuration.
      Overrides:
      getDelegate in class DelegatedMutableConfig
      Returns:
      The delegate configuration.
    • 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.
    • notifyDelegateChanges

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