Creates a new ConfigParams and fills it with values.
(optional) an object to be converted into key-value pairs to initialize this config map.
Adds parameters into this ConfigParams under specified section. Keys for the new parameters are appended with section dot prefix.
name of the section where add new parameters
new parameters to be added.
Appends new elements to this map.
a map with elements to be added.
Clears this map by removing all its elements.
Creates a binary clone of this object.
a clone of this object.
Gets a map element specified by its key.
a key of the element to get.
the value of the map element.
Converts map element into an AnyValueArray or returns empty AnyValueArray if conversion is not possible.
a key of element to get.
AnyValueArray value of the element or empty AnyValueArray if conversion is not supported.
Converts map element into an AnyValueArray or returns default value if conversion is not possible.
a key of element to get.
the default value
AnyValueArray value of the element or default value if conversion is not supported.
Converts map element into a boolean or returns false if conversion is not possible.
a key of element to get.
boolean value of the element or false if conversion is not supported.
Converts map element into a boolean or returns default value if conversion is not possible.
a key of element to get.
the default value
boolean value of the element or default value if conversion is not supported.
Converts map element into a Date or returns the current date if conversion is not possible.
a key of element to get.
Date value of the element or the current date if conversion is not supported.
Converts map element into a Date or returns default value if conversion is not possible.
a key of element to get.
the default value
Date value of the element or default value if conversion is not supported.
Converts map element into a double or returns 0 if conversion is not possible.
a key of element to get.
double value of the element or 0 if conversion is not supported.
Converts map element into a double or returns default value if conversion is not possible.
a key of element to get.
the default value
double value of the element or default value if conversion is not supported.
Converts map element into a float or returns 0 if conversion is not possible.
a key of element to get.
float value of the element or 0 if conversion is not supported.
Converts map element into a flot or returns default value if conversion is not possible.
a key of element to get.
the default value
flot value of the element or default value if conversion is not supported.
Converts map element into an integer or returns 0 if conversion is not possible.
a key of element to get.
integer value of the element or 0 if conversion is not supported.
Converts map element into an integer or returns default value if conversion is not possible.
a key of element to get.
the default value
integer value of the element or default value if conversion is not supported.
Converts map element into a long or returns 0 if conversion is not possible.
a key of element to get.
long value of the element or 0 if conversion is not supported.
Converts map element into a long or returns default value if conversion is not possible.
a key of element to get.
the default value
long value of the element or default value if conversion is not supported.
Converts map element into an AnyValueMap or returns empty AnyValueMap if conversion is not possible.
a key of element to get.
AnyValueMap value of the element or empty AnyValueMap if conversion is not supported.
Converts map element into an AnyValueMap or returns default value if conversion is not possible.
a key of element to get.
the default value
AnyValueMap value of the element or default value if conversion is not supported.
Converts map element into an AnyValueArray or returns null if conversion is not possible.
a key of element to get.
AnyValueArray value of the element or null if conversion is not supported.
Converts map element into a boolean or returns null if conversion is not possible.
a key of element to get.
boolean value of the element or null if conversion is not supported.
Converts map element into a Date or returns null if conversion is not possible.
a key of element to get.
Date value of the element or null if conversion is not supported.
Converts map element into a double or returns null if conversion is not possible.
a key of element to get.
double value of the element or null if conversion is not supported.
Converts map element into a float or returns null if conversion is not possible.
a key of element to get.
float value of the element or null if conversion is not supported.
Converts map element into an integer or returns null if conversion is not possible.
a key of element to get.
integer value of the element or null if conversion is not supported.
Converts map element into a long or returns null if conversion is not possible.
a key of element to get.
long value of the element or null if conversion is not supported.
Converts map element into an AnyValueMap or returns null if conversion is not possible.
a key of element to get.
AnyValueMap value of the element or null if conversion is not supported.
Converts map element into a string or returns null if conversion is not possible.
a key of element to get.
string value of the element or null if conversion is not supported.
Converts map element into a value defined by specied typecode. If conversion is not possible it returns null.
the TypeCode that defined the type of the result
a key of element to get.
element value defined by the typecode or null if conversion is not supported.
Gets the value stored in map element without any conversions. When element key is not defined it returns the entire map value.
(optional) a key of the element to get
the element value or value of the map when index is not defined.
Converts map element into a string or returns "" if conversion is not possible.
a key of element to get.
string value of the element or "" if conversion is not supported.
Converts map element into a string or returns default value if conversion is not possible.
a key of element to get.
the default value
string value of the element or default value if conversion is not supported.
Converts map element into a value defined by specied typecode. If conversion is not possible it returns default value for the specified type.
the TypeCode that defined the type of the result
a key of element to get.
element value defined by the typecode or default if conversion is not supported.
Converts map element into a value defined by specied typecode. If conversion is not possible it returns default value.
the TypeCode that defined the type of the result
a key of element to get.
the default value
element value defined by the typecode or default value if conversion is not supported.
Converts map element into an AnyValue or returns an empty AnyValue if conversion is not possible.
a key of element to get.
AnyValue value of the element or empty AnyValue if conversion is not supported.
Gets keys of all elements stored in this map.
a list with all map keys.
Gets parameters from specific section stored in this ConfigMap. The section name is removed from parameter keys.
name of the section to retrieve configuration parameters from.
all configuration parameters that belong to the section named 'section'.
Gets a list with all 1st level section names.
a list of section names stored in this ConfigMap.
Gets a number of elements stored in this map.
the number of elements in this map.
Overrides parameters with new values from specified ConfigParams and returns a new ConfigParams object.
ConfigMap with parameters to override the current values.
a new ConfigParams object.
Puts a new value into map element specified by its key.
a key of the element to put.
a new value for map element.
Removes a map element specified by its key
a key of the element to remove.
Sets a new value to map element specified by its index. When the index is not defined, it resets the entire map value. This method has double purpose because method overrides are not supported in JavaScript.
(optional) a key of the element to set
a new element or map value.
Set default values from specified ConfigParams and returns a new ConfigParams object.
ConfigMap with default parameter values.
a new ConfigParams object.
Gets a string representation of the object. The result is a semicolon-separated list of key-value pairs as "key1=value1;key2=value2;key=value3"
a string representation of the object.
Creates a new AnyValueMap by merging two or more maps. Maps defined later in the list override values from previously defined maps.
an array of maps to be merged
a newly created AnyValueMap.
Creates a new ConfigParams object filled with key-value pairs serialized as a string.
a string with serialized key-value pairs as "key1=value1;key2=value2;..." Example: "Key1=123;Key2=ABC;Key3=2016-09-16T00:00:00.00Z"
a new ConfigParams object.
Creates a new ConfigParams object filled with provided key-value pairs called tuples. Tuples parameters contain a sequence of key1, value1, key2, value2, ... pairs.
the tuples to fill a new ConfigParams object.
a new ConfigParams object.
Creates a new StringValueMap from a list of key-value pairs called tuples. The method is similar to fromTuples but tuples are passed as array instead of parameters.
a list of values where odd elements are keys and the following even elements are values
a newly created StringValueMap.
Creates a new ConfigParams object filled with key-value pairs from specified object.
an object with key-value pairs used to initialize a new ConfigParams.
a new ConfigParams object.
Merges two or more ConfigParams into one. The following ConfigParams override previously defined parameters.
a list of ConfigParams objects to be merged.
a new ConfigParams object.
Generated using TypeDoc
Contains a key-value map with configuration parameters. All values stored as strings and can be serialized as JSON or string forms. When retrieved the values can be automatically converted on read using GetAsXXX methods.
The keys are case-sensitive, so it is recommended to use consistent C-style as:
"my_param"
Configuration parameters can be broken into sections and subsections using dot notation as:
"section1.subsection1.param1"
. Using GetSection method all parameters from specified section can be extracted from a ConfigMap.The ConfigParams supports serialization from/to plain strings as:
"key1=123;key2=ABC;key3=2016-09-16T00:00:00.00Z"
ConfigParams are used to pass configurations to IConfigurable objects. They also serve as a basis for more concrete configurations such as ConnectionParams or CredentialParams (in the Pip.Services components package).
IConfigurable
StringValueMap
Example
let config = ConfigParams.fromTuples( "section1.key1", "AAA", "section1.key2", 123, "section2.key1", true ); config.getAsString("section1.key1"); // Result: AAA config.getAsInteger("section1.key1"); // Result: 0 section1 = config.getSection("section1"); section1.toString(); // Result: key1=AAA;key2=123