Implements: IContext
Description
TODO: add description
Constructors
Creates a new instance of the map and assigns its value.
publicconstructor(values: any = null)
- values: any - (optional) object to be converted into key-value pairs to initialize this config map.
Instance Methods
Get
Adds parameters into this ConfigParams under a specified section. Keys for the new parameters are appended with section dot prefix.
publicobject Get(string key)
- key: string - a key of the element to get.
- returns: object - the value of the map element.
toJson
Converts this map to JSON object.
publictoJson(): string
- returns: string - a JSON representation of this map.
Static methods
FromConfig
Creates new Context from ConfigMap object.
public staticContext FromConfig(ConfigParams config)
- config: ConfigParams - a ConfigParams that contain parameters.
- returns: Context - a new Context object.
FromTraceId
Creates new Context from traceId.
public staticContext FromTraceId(string traceId)
- traceId: string - a transaction id to trace execution through call chain.
- returns: Context - a new Context object.
FromTuples
Creates a new Context object filled with provided key-value pairs called tuples. Tuples parameters contain a sequence of key1, value1, key2, value2, … pairs.
`public static Context FromTuples(params object[] tuples)
- tuples: any[] - tuples to fill a new ConfigParams object.
- returns: a new Context object.
FromValue
Creates a new Context object filled with key-value pairs from specified object.
public staticContext FromValue(IDictionary<string, object> values)
- value: any - an object with key-value pairs used to initialize a new Context.
- returns: a new Context object.
fromJson
Creates a new Parameters object filled with key-value pairs from specified object.
public staticfromJson(json: string): Context
- value: any - object with key-value pairs used to initialize a new ConfigParams.
- returns: ConfigParams - new ConfigParams object.