Class ConfigMap

java.lang.Object
io.github.arthurhoch.kissconfig.ConfigMap

public final class ConfigMap extends Object
Immutable normalized configuration map.
  • Constructor Details

    • ConfigMap

      public ConfigMap(Map<String,ConfigValue> values)
      Creates a config map from normalized keys to config values.
      Parameters:
      values - values to copy
  • Method Details

    • get

      public Optional<String> get(String key)
      Returns the string value for a key after normalizing the requested key.
      Parameters:
      key - raw or canonical key
      Returns:
      optional string value
    • getValue

      public Optional<ConfigValue> getValue(String key)
      Returns the full config value for a key after normalizing the requested key.
      Parameters:
      key - raw or canonical key
      Returns:
      optional config value
    • containsKey

      public boolean containsKey(String key)
      Returns true when the key exists after normalization.
      Parameters:
      key - raw or canonical key
      Returns:
      whether the key exists
    • valuesByKey

      public Map<String,ConfigValue> valuesByKey()
      Returns immutable values keyed by canonical key.
      Returns:
      values by key
    • asMap

      public Map<String,String> asMap()
      Returns a string-only view keyed by canonical key.
      Returns:
      string map
    • values

      public Collection<ConfigValue> values()
      Returns the config values in deterministic key order.
      Returns:
      config values
    • withSecretKeys

      public ConfigMap withSecretKeys(Set<String> secretKeys)
      Returns a copy with additional keys marked as secret.
      Parameters:
      secretKeys - canonical or raw keys to mark secret
      Returns:
      copied config map