Functions - config

contains

Checks whether the given key is in the configuration registry.

getAsArray

Retrieves the specified configuration value as an array. If there is no mapping, an empty array will be returned.

getAsBoolean

Retrieves the specified configuration value as a boolean.

getAsFloat

Retrieves the specified configuration value as a float.

getAsInt

Retrieves the specified configuration value as an int.

getAsMap

Retrieves the specified configuration value as a map. If there is no mapping, an empty map will be returned.

getAsString

Retrieves the specified configuration value as a string.

setConfig

Sets the specified key/value pair as a configuration.

contains

(string key)

returns boolean

Checks whether the given key is in the configuration registry.

Parameters

  • key string
  • The configuration key to be looked-up

  • Return Type

    (boolean)
  • Returns true if the key is present; if not returs false

getAsArray

(string key)

returns anydata[]

Retrieves the specified configuration value as an array. If there is no mapping, an empty array will be returned.

Parameters

  • key string
  • The configuration to be retrieved

  • Return Type

    (anydata[])
  • Configuration value mapped by the key

getAsBoolean

(string key, boolean defaultValue)

returns boolean

Retrieves the specified configuration value as a boolean.

Parameters

  • key string
  • The configuration to be retrieved

  • defaultValue boolean (default false)
  • The default value to be use in case there is no mapping for the provided key

  • Return Type

    (boolean)
  • Configuration value mapped by the key

getAsFloat

(string key, float defaultVal)

returns float

Retrieves the specified configuration value as a float.

Parameters

  • key string
  • The configuration to be retrieved

  • defaultVal float (default 0.0)
  • The default value to be use in case there is no mapping for the provided key

  • Return Type

    (float)
  • Configuration value mapped by the key

getAsInt

(string key, int defaultValue)

returns int

Retrieves the specified configuration value as an int.

Parameters

  • key string
  • The configuration to be retrieved

  • defaultValue int (default 0)
  • The default value to be use in case there is no mapping for the provided key

  • Return Type

    (int)
  • Configuration value mapped by the key

getAsMap

(string key)

returns map

Retrieves the specified configuration value as a map. If there is no mapping, an empty map will be returned.

Parameters

  • key string
  • The configuration to be retrieved

  • Return Type

    (map)
  • Configuration value mapped by the key

getAsString

(string key, string defaultValue)

returns string

Retrieves the specified configuration value as a string.

Parameters

  • key string
  • The configuration to be retrieved

  • defaultValue string
  • The default value to be use in case there is no mapping for the provided key

  • Return Type

    (string)
  • Configuration value mapped by the key

setConfig

Sets the specified key/value pair as a configuration.

Parameters

  • key string
  • The key of the configuration value to be set

  • value string | int | float | boolean
  • The configuration value to be set