Package ai.dat.core.configuration
Interface ReadableConfig
- All Known Implementing Classes:
Configuration
public interface ReadableConfig
Read access to a configuration object.
Allows reading values described with meta information included in
ConfigOption.-
Method Summary
Modifier and TypeMethodDescription<T> Tget(ConfigOption<T> option) Reads a value using the metadata included inConfigOption.<T> Optional<T>getOptional(ConfigOption<T> option) Reads a value using the metadata included inConfigOption.toMap()Converts the configuration items into a map of string key-value pairs.
-
Method Details
-
get
Reads a value using the metadata included inConfigOption. Returns theConfigOption.defaultValue()if value key not present in the configuration.- Type Parameters:
T- type of the value to read- Parameters:
option- metadata of the option to read- Returns:
- read value or
ConfigOption.defaultValue()if not found - See Also:
-
getOptional
Reads a value using the metadata included inConfigOption. In contrast toget(ConfigOption)returnsOptional.empty()if value not present.- Type Parameters:
T- type of the value to read- Parameters:
option- metadata of the option to read- Returns:
- read value or
Optional.empty()if not found - See Also:
-
toMap
Converts the configuration items into a map of string key-value pairs.- Returns:
- a map containing the configuration properties, where the keys are strings and the values are the corresponding configuration values in string format.
-