Class JsonConfigImpl

All Implemented Interfaces:
Config
Direct Known Subclasses:
JsonMutableConfigImpl, YamlConfigImpl

@API(status=INTERNAL, since="1.0") public class JsonConfigImpl extends AbstractWatchableConfig
Jackson ObjectNode based configuration.
Since:
1.0
Version:
1.0, 2025-07
Author:
(w) Iker Hernaez
See Also:
  • Constructor Details

    • JsonConfigImpl

      public JsonConfigImpl(ConfigOptions options, JsonConfigOptions jsonOptions)
      Creates a new instance.
      Parameters:
      options - The configuration builder options.
      jsonOptions - The JSON based configuration builder options.
    • JsonConfigImpl

      protected JsonConfigImpl(ConfigOptions options, MutableConfigOptions mutableOptions, JsonConfigOptions jsonOptions)
      Creates a new instance.
      Parameters:
      options - The configuration builder options.
      mutableOptions - The mutable configuration builder options.
      jsonOptions - The JSON based configuration builder options.
  • Method Details

    • getJsonObject

      protected com.fasterxml.jackson.databind.node.ObjectNode getJsonObject()
      Returns the JSON object with the configuration properties.
      Returns:
      The JSON object with the configuration properties.
    • getPropertySeparator

      protected String getPropertySeparator()
      Returns the configuration nested properties separator.
      Returns:
      The configuration nested properties separator.
    • 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.
    • getKeysInt

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

      protected boolean containsInt(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.
    • getInt

      protected @Nullable String getInt(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.
    • propertyToPointer

      protected com.fasterxml.jackson.core.JsonPointer propertyToPointer(String key)
      Resolves configuration keys to JSON pointer expressions by replacing properties separator with the JSON pointer segment separator.
      Parameters:
      key - The configuration key.
      Returns:
      The JSON pointer expression.
    • keysFlattener

      protected static Stream<String> keysFlattener(String separator, String prefix, String key, com.fasterxml.jackson.databind.JsonNode node)
      Flattens the JSON object properties to a stream of keys.
      Parameters:
      separator - The properties separator to use.
      prefix - The prefix for the keys.
      key - The current key being processed.
      node - The JSON object node entry.
      Returns:
      A stream of flattened keys.