java.lang.Object
dev.orne.config.DelegatedConfig
dev.orne.config.DelegatedMutableConfig
dev.orne.config.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
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.orne.config.WatchableConfig
WatchableConfig.Listener -
Constructor Summary
ConstructorsConstructorDescriptionDelegatedWatchableConfig(@NotNull WatchableConfig delegate) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(@NotNull WatchableConfig.Listener listener) Registers the specified configuration change events listener.protected @NotNull WatchableConfigReturns the delegate configuration.protected voidnotifyDelegateChanges(@NotNull Set<String> keys) Notifies configuration properties changed through delegate configuration to all registered listeners.voidremoveListener(@NotNull WatchableConfig.Listener listener) Unregisters the specified configuration change events listener.Methods inherited from class dev.orne.config.DelegatedConfig
contains, get, get, get, getBoolean, getBoolean, getBoolean, getInteger, getInteger, getInteger, getKeys, getKeys, getKeys, getLong, getLong, getLong, getParent, getUndecored, isEmptyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.orne.config.Config
as, contains, get, get, get, getBoolean, getBoolean, getBoolean, getInteger, getInteger, getInteger, getKeys, getKeys, getKeys, getLong, getLong, getLong, getParent, getUndecored, isEmptyMethods inherited from interface dev.orne.config.WatchableConfig
subset
-
Constructor Details
-
DelegatedWatchableConfig
Creates a new instance.- Parameters:
delegate- The configuration to delegate to.
-
-
Method Details
-
getDelegate
Returns the delegate configuration.- Overrides:
getDelegatein classDelegatedMutableConfig- Returns:
- The delegate configuration.
-
addListener
Registers the specified configuration change events listener.- Specified by:
addListenerin interfaceWatchableConfig- Parameters:
listener- The listener to be called on configuration changes.
-
removeListener
Unregisters the specified configuration change events listener.- Specified by:
removeListenerin interfaceWatchableConfig- Parameters:
listener- The listener to previously registered.
-
notifyDelegateChanges
Notifies configuration properties changed through delegate configuration to all registered listeners.- Parameters:
keys- The changed configuration properties.
-