Class DelegatedMutableConfig

java.lang.Object
dev.orne.config.DelegatedConfig
dev.orne.config.DelegatedMutableConfig
All Implemented Interfaces:
Config, MutableConfig
Direct Known Subclasses:
DelegatedWatchableConfig

@API(status=STABLE, since="1.0") public class DelegatedMutableConfig extends DelegatedConfig implements MutableConfig
A 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

    • DelegatedMutableConfig

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

    • getDelegate

      @NotNull protected @NotNull MutableConfig getDelegate()
      Returns the delegate configuration.
      Overrides:
      getDelegate in class DelegatedConfig
      Returns:
      The delegate configuration.
    • set

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

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

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

      public void set(@NotBlank @NotBlank String key, Long value)
      Sets the value of the configuration parameter.
      Specified by:
      set in interface MutableConfig
      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
      Parameters:
      keys - The configuration properties.