Merge 2 configurations.
Retrieves a configuration value as a Boolean
.
Retrieves a configuration value as a Boolean
.
For example:
val configuration = Configuration.load() val isEnabled = configuration.getString("engine.isEnabled")
A configuration error will be thrown if the configuration value is not a valid Boolean
.
Authorized vales are yes/no or true/false.
a configuration value
Retrieves a configuration value as Bytes
.
Retrieves a configuration value as Bytes
.
For example:
val configuration = Configuration.load() val maxSize = configuration.getString("engine.maxSize")
The configuratioon must be provided as:
engine.maxSize = 512k
Retrieves a sub-configuration, i.
Retrieves a sub-configuration, i.e. a configuration instance containing all keys starting with a given prefix.
For example:
val configuration = Configuration.load() val engineConfig = configuration.getSub("engine")
The root key of this new configuration will be ‘engine’, and you can access any sub-keys relatively.
a new configuration
Retrieves a configuration value as an Int
.
Retrieves a configuration value as an Int
.
For example:
val configuration = Configuration.load() val poolSize = configuration.getInt("engine.pool.size")
A configuration error will be thrown if the configuration value is not a valid Int
.
a configuration value
Retrieves a configuration value as Milliseconds
.
Retrieves a configuration value as Milliseconds
.
For example:
val configuration = Configuration.load() val timeout = configuration.getString("engine.timeout")
The configuratioon must be provided as:
engine.timeout = 1 second
Retrieves a configuration value as a String
.
Retrieves a configuration value as a String
.
This method supports an optional set of valid values:
val config = Configuration.load() val mode = config.getString("engine.mode", Some(Set("dev","prod")))
A configuration error will be thrown if the configuration value does not match any of the required values.
valid values for this configuration
a configuration value
Creates a configuration error for this configuration.
Creates a configuration error for this configuration.
For example:
val configuration = Configuration.load() throw configuration.globalError("Missing configuration key: [yop.url]")
the error message
the related exception
a configuration exception
Returns available keys.
Returns available keys.
For example:
val configuration = Configuration.load() val keys = configuration.keys
the set of keys available in this configuration
Creates a configuration error for a specific configuration key.
Creates a configuration error for a specific configuration key.
For example:
val configuration = Configuration.load() throw configuration.reportError("engine.connectionUrl", "Cannot connect!")
the error message
the related exception
a configuration exception
Returns sub-keys.
Returns sub-keys.
For example:
val configuration = Configuration.load() val subKeys = configuration.subKeys
the set of direct sub-keys available in this configuration
the underlying Config implementation
A full configuration set.
The underlying implementation is provided by https://github.com/typesafehub/config.
the underlying Config implementation