Looks up a single value of a specific type in configuration.
Looks up a single value of a specific type in configuration. If the configuration key does not exist, an exception is thrown. If the requested type is not supported, an exception is thrown.
Converts the configuration path to the given type.
Converts the configuration path to the given type. If the requested type is not supported, an exception is thrown. Override this method to support custom types.
The configuration to query.
The configuration to query.
Method to fetch a configuration key that may or may not be present.
Method to fetch a configuration key that may or may not be present.
Optionally accesses a configuration value.
Optionally accesses a configuration value. If the value is not present in the configuration a None will be returned, else a Some(T) of the appropriate type.
Optionally accesses a configuration value.
Optionally accesses a configuration value. If the value is not present in the configuration a the default value will be returned.
Method to allow subclasses to override how errors are handled, e.g.
Method to allow subclasses to override how errors are handled, e.g. by logging or throwing different exceptions.
Method that can be overridden to receive a call each time a configuration path is requested.
Method that can be overridden to receive a call each time a configuration path is requested.
Returns a sorted set of all keys that have been requested up to this point in time.
Class that provides useful methods for resolving all kinds of things in configuration. Uses Config to retrieve configuration values in a type-safe way.
The
requestedKeys
method returns all the keys requested.The public methods to retrieve values are the
apply
,get
, andgetOrElse
methods.A common pattern is to create an
object
that extends this class, and reference that object when retrieving values from a path. An additional trait is created that references the custom configuration object, allowing other classes to mix in the additional trait to get access the the configuration methods that use the custom configuration object.A common pattern is to create an
object
that extends this class, and reference that object when retrieving values from a path.