ConfigDictionary.get - multiple declarations

Function ConfigDictionary.get

Get values from the configuration using config path notation.

string get (
  string configPath,
  string defaultValue = null
);

Parameters

NameDescription
configPath Path to the wanted config value. The path is separated by dots, e.g. "server.public.hostname". Values from arrays can be selected by brackets, for example: "server[3].hostname.ports[0]". When the config is just a value, for example just a string, it can be fetched by just specifying "." as path. Although the path should be universally the same over all types of config files, some might not lend to this structure, and have a more specific way of retrieving data from the config. See the examples and specific config factories for more details.
defaultValue (Optional) Value to return when the given configPath is invalid. When not supplied a ConfigPathNotFoundException exception is thrown.

Throws

ConfigReadException when something goes wrong reading the config. ConfigPathNotFoundException when the given path does not exist in the config.

Returns

The value at the path in the configuration. To convert it use get!T().

Function ConfigDictionary.get

Get values from the configuration and attempts to convert them to the specified type.

ConvertToType get(ConvertToType) (
  string configPath
);

Parameters

NameDescription
configPath Path to the wanted config value. See get().

Throws

ConfigReadException when something goes wrong reading the config. ConfigPathNotFoundException when the given path does not exist in the config.

Returns

The value at the path in the configuration.

See Also

get

Function ConfigDictionary.get

Get values from the configuration and attempts to convert them to the specified type.

ConvertToType get(ConvertToType) (
  string configPath,
  ConvertToType defaultValue
);

Parameters

NameDescription
configPath Path to the wanted config value. See get().
defaultValue (Optional) Value to return when the given configPath is invalid. When not supplied a ConfigPathNotFoundException exception is thrown.

Throws

ConfigReadException when something goes wrong reading the config. ConfigPathNotFoundException when the given path does not exist in the config.

Returns

The value at the path in the configuration.

See Also

get