Adds a configuration source to the configuration.
This method is not guaranteed to be thread-safe, so it should not be called concurrently with other methods that modify the configuration. Methods which read the configuration may be called concurrently, but may not reflect changes made by this method.
This method is typically used to add configuration sources that have been created or loaded dynamically, such as configuration files, environment variables, or other sources of configuration data.
The same ConfigSource instance can only be added once. If the same source is added again, a DuplicateConfigSourceError will be thrown. This is to ensure that each configuration source is unique within the configuration.
A ConfigSource with the same name and ordinal as an existing source will be considered a duplicate, even if it is a different instance.
The configuration source to be added.
Retrieves the value of the specified key from the configuration source and converts it to a boolean.
The key to use to retrieve the value from the configuration source.
The value of the specified key as a boolean.
Retrieves the value of the specified key from the configuration source and converts it to a number.
The key to use to retrieve the value from the configuration source.
The value of the specified key as a number.
Retrieves the value of the specified key from the configuration source and converts it an object of the specified type. If the key is not specified, the method returns the entire configuration as an object.
The class of the object to which the value should be converted.
Optional
key: stringThe key to use to retrieve the value from the configuration source.
The value of the specified key as a boolean.
Retrieves the value of the specified key from the configuration source and converts it to an array of objects of the specified type. If the key is not specified, the method returns the entire configuration as an array of objects.
The class of the objects to which the values should be converted.
The key to use to retrieve the values from the configuration source.
Retrieves the value of the specified key from the configuration source and converts it to a string.
The key to use to retrieve the value from the configuration source.
The value of the specified key as a string.
Retrieves the value of the specified key from the configuration source and converts it to a string array.
The key to use to retrieve the value from the configuration source.
The value of the specified key as a string array.
Enumerates the key-value pairs that are available in the configuration source.
A map of key-value pairs that are available in the configuration source.
Enumerates the set of property names that are available in the configuration source.
A set of property names that are available in the configuration source.
Reloads the configuration source from the underlying storage backend.
Represents a single application wide multi-layer configuration.