Interface MutableConfig

All Superinterfaces:
Config
All Known Subinterfaces:
FileMutableConfig, FileWatchableConfig, PreferencesMutableConfig, WatchableConfig
All Known Implementing Classes:
AbstractMutableConfig, AbstractWatchableConfig, CommonsMutableConfigImpl, DelegatedMutableConfig, DelegatedWatchableConfig, JsonMutableConfigImpl, PreferencesMutableConfigImpl, PropertiesMutableConfigImpl, XmlMutableConfigImpl, YamlMutableConfigImpl

@API(status=STABLE, since="1.0") public interface MutableConfig extends Config
Configuration properties provider with properties mutable at runtime.
Since:
0.1
Version:
1.0, 2019-07, 2.0, 2025-04
Author:
(w) Iker Hernaez
See Also:
  • Method Details

    • set

      void set(@NotBlank @NotBlank String key, String value)
      Sets the value of the specified configuration property.
      Parameters:
      key - The configuration property.
      value - The value to set
      Throws:
      ConfigException - If an error occurs setting the configuration property value
    • set

      default void set(@NotBlank @NotBlank String key, Boolean value)
      Sets the value of the configuration parameter.
      Parameters:
      key - The configuration property.
      value - The value to set
      Throws:
      ConfigException - If an error occurs setting the configuration property value
    • set

      default void set(@NotBlank @NotBlank String key, Integer value)
      Sets the value of the configuration parameter.
      Parameters:
      key - The configuration property.
      value - The value to set
      Throws:
      ConfigException - If an error occurs setting the configuration property value
    • set

      default void set(@NotBlank @NotBlank String key, Long value)
      Sets the value of the configuration parameter.
      Parameters:
      key - The configuration property.
      value - The value to set
      Throws:
      ConfigException - If an error occurs setting the configuration property value
    • remove

      void remove(@NotBlank @NotBlank String... keys)
      Removes the specified configuration properties.
      Parameters:
      keys - The configuration properties.
      Throws:
      ConfigException - If an error occurs removing the configuration properties.
    • subset

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