Interface WatchableConfig

All Superinterfaces:
Config, MutableConfig
All Known Subinterfaces:
FileWatchableConfig, PreferencesMutableConfig
All Known Implementing Classes:
AbstractWatchableConfig, CommonsMutableConfigImpl, DelegatedWatchableConfig, JsonMutableConfigImpl, PreferencesMutableConfigImpl, PropertiesMutableConfigImpl, XmlMutableConfigImpl, YamlMutableConfigImpl

@API(status=STABLE, since="1.0") public interface WatchableConfig extends MutableConfig
Watchable mutable configuration properties provider.
Since:
1.0
Version:
1.0, 2025-04
Author:
(w) Iker Hernaez
See Also:
  • Method Details

    • addListener

      void addListener(@NotNull @NotNull WatchableConfig.Listener listener)
      Registers the specified configuration change events listener.
      Parameters:
      listener - The listener to be called on configuration changes.
      Throws:
      IllegalStateException - If the configuration type does not support event listeners.
    • removeListener

      void removeListener(@NotNull @NotNull WatchableConfig.Listener listener)
      Unregisters the specified configuration change events listener.
      Parameters:
      listener - The listener to previously registered.
    • subset

      @NotNull default @NotNull WatchableConfig subset(@NotNull @NotNull String prefix)
      Creates a subset configuration containing only the properties with the specified prefix.
      Specified by:
      subset in interface Config
      Specified by:
      subset in interface MutableConfig
      Parameters:
      prefix - The prefix for configuration keys.
      Returns:
      The subset configuration.