ConfigWrapper
An abstraction for an underlying configuration store. Decouples config delegates from the underlying config framework.
Functions
Adds a default value to be used in absence of a value provided by the client.
Gets the specified Boolean configuration value. If the value is not set or not a valid boolean, the default value provided by addDefault is returned.
Gets the specified List of Boolean configuration value. If the value is not set or not a valid boolean list, the default value provided by addDefault is returned. A key present without a value reads as an empty list. Elements that cannot be converted are skipped with a warning.
Returns the comment lines of the key at path without the leading # , or an empty list if none. The file header is not part of the first key's comments.
Gets the specified List of Double configuration value. If the value is not set or not a valid double list, the default value provided by addDefault is returned. A key present without a value reads as an empty list. Elements that cannot be converted are skipped with a warning.
Gets the specified List of Int configuration value. If the value is not set or not a valid integer list, the default value provided by addDefault is returned. A key present without a value reads as an empty list. Elements that cannot be converted are skipped with a warning.
Gets the specified List of Long configuration value. If the value is not set or not a valid long list, the default value provided by addDefault is returned. A key present without a value reads as an empty list. Elements that cannot be converted are skipped with a warning.
Gets the specified flat Map indexed by String configuration value. If the value is not set or not a valid Map, the default value provided by addDefault is returned. A key present without a value reads as an empty map. Entries without a value, lists and nested sections are skipped with a warning. Values are returned as String, whether loaded from the file, set or provided by addDefault: values loaded from the file as typed there (1.10 stays 1.10), other values converted with toString.
Gets the specified String configuration value. If the value is not set or not a valid string, the default value provided by addDefault is returned. Values loaded from the file are returned as typed there (1.10 stays 1.10, 007 stays 007).
Gets the specified List of String configuration value. If the value is not set or not a valid string list, the default value provided by addDefault is returned. A key present without a value reads as an empty list. Elements that cannot be converted are skipped with a warning. Elements loaded from the file are returned as typed there (1.10 stays 1.10).
Reloads all configuration values from the underlying config representation, for example from file.
Stores the default values provided by addDefault for any path that has no user provided value. If the underlying config representation does not exist, it is created and initiated with the default values. A list or map key that is present without a value is written as an empty list or map instead of the default.