Package io.github.arthurhoch.kissconfig
Class ConfigMap
java.lang.Object
io.github.arthurhoch.kissconfig.ConfigMap
Immutable normalized configuration map.
-
Constructor Summary
ConstructorsConstructorDescriptionConfigMap(Map<String, ConfigValue> values) Creates a config map from normalized keys to config values. -
Method Summary
Modifier and TypeMethodDescriptionasMap()Returns a string-only view keyed by canonical key.booleancontainsKey(String key) Returns true when the key exists after normalization.Returns the string value for a key after normalizing the requested key.Returns the full config value for a key after normalizing the requested key.values()Returns the config values in deterministic key order.Returns immutable values keyed by canonical key.withSecretKeys(Set<String> secretKeys) Returns a copy with additional keys marked as secret.
-
Constructor Details
-
ConfigMap
Creates a config map from normalized keys to config values.- Parameters:
values- values to copy
-
-
Method Details
-
get
Returns the string value for a key after normalizing the requested key.- Parameters:
key- raw or canonical key- Returns:
- optional string value
-
getValue
Returns the full config value for a key after normalizing the requested key.- Parameters:
key- raw or canonical key- Returns:
- optional config value
-
containsKey
Returns true when the key exists after normalization.- Parameters:
key- raw or canonical key- Returns:
- whether the key exists
-
valuesByKey
Returns immutable values keyed by canonical key.- Returns:
- values by key
-
asMap
Returns a string-only view keyed by canonical key.- Returns:
- string map
-
values
Returns the config values in deterministic key order.- Returns:
- config values
-
withSecretKeys
Returns a copy with additional keys marked as secret.- Parameters:
secretKeys- canonical or raw keys to mark secret- Returns:
- copied config map
-