Class PropertiesMutableConfigImpl

All Implemented Interfaces:
Config, FileMutableConfig, FileWatchableConfig, MutableConfig, WatchableConfig

@API(status=INTERNAL, since="1.0") public class PropertiesMutableConfigImpl extends AbstractWatchableConfig implements FileWatchableConfig
Properties based mutable configuration.
Since:
1.0
Version:
1.0, 2025-04
Author:
(w) Iker Hernaez
See Also:
  • Constructor Details

    • PropertiesMutableConfigImpl

      public PropertiesMutableConfigImpl(@NotNull @NotNull ConfigOptions options, @NotNull @NotNull MutableConfigOptions mutableOptions, @NotNull @NotNull PropertiesConfigOptions propertyOptions)
      Creates a new instance.
      Parameters:
      options - The configuration builder options.
      mutableOptions - The mutable configuration builder options.
      propertyOptions - The properties based configuration builder options.
  • Method Details

    • getProperties

      @NotNull protected @NotNull Properties getProperties()
      Returns the internal Properties instance.
      Returns:
      The configuration properties.
    • isEmptyInt

      protected boolean isEmptyInt()
      Returns true if this configuration instance contains no property.

      Parent configuration

      Specified by:
      isEmptyInt in class AbstractConfig
      Returns:
      Returns true if the configuration contains no property.
    • containsInt

      protected boolean containsInt(@NotBlank @NotBlank String key)
      Returns true if the property with the key passed as argument has been configured in this configuration instance.
      Specified by:
      containsInt in class AbstractConfig
      Parameters:
      key - The configuration property.
      Returns:
      Returns true if the property has been configured.
    • getKeysInt

      @NotNull protected @NotNull Stream<String> getKeysInt()
      Returns the configuration property keys contained in this configuration instance .
      Specified by:
      getKeysInt in class AbstractConfig
      Returns:
      The configuration property keys.
    • getInt

      protected String getInt(@NotBlank @NotBlank String key)
      Returns the value of the configuration property as String.
      Specified by:
      getInt in class AbstractConfig
      Parameters:
      key - The configuration property.
      Returns:
      The configuration parameter value.
    • setInt

      protected void setInt(@NotBlank @NotBlank String key, @NotNull @NotNull String value)
      Sets the value of the specified configuration property.
      Specified by:
      setInt in class AbstractMutableConfig
      Parameters:
      key - The configuration property.
      value - The value to set
    • removeInt

      protected void removeInt(@NotBlank @NotBlank String... keys)
      Removes the specified configuration properties.
      Specified by:
      removeInt in class AbstractMutableConfig
      Parameters:
      keys - The configuration properties.
    • save

      public void save(@NotNull @NotNull OutputStream destination) throws IOException
      Saves the configuration properties to the specified output stream. If the file format requires it, the saved content will be encoded using the default encoding (usually UTF-8).
      Specified by:
      save in interface FileMutableConfig
      Parameters:
      destination - The destination output stream.
      Throws:
      IOException - If an I/O error occurs.
    • save

      public void save(@NotNull @NotNull Writer destination) throws IOException
      Saves the configuration properties to the specified writer.
      Specified by:
      save in interface FileMutableConfig
      Parameters:
      destination - The destination writer.
      Throws:
      IOException - If an I/O error occurs.