Pip-Services-Commons-Dotnet
Public Member Functions | Static Public Member Functions | List of all members
PipServices3.Commons.Run.Parameters Class Reference

Contains map with execution parameters. More...

Inheritance diagram for PipServices3.Commons.Run.Parameters:
PipServices3.Commons.Data.AnyValueMap PipServices3.Commons.Data.ICloneable

Public Member Functions

 Parameters ()
 Creates a new instance of the map. More...
 
 Parameters (IDictionary values)
 Creates a new instance of the map and assigns its value. More...
 
override object Get (string path)
 Gets a map element specified by its key. More...
 
override void Set (string path, object value)
 Sets a new value into map element specified by its key. More...
 
Parameters GetAsNullableParameters (string key)
 Converts map element into an Parameters or returns null if conversion is not possible. More...
 
Parameters GetAsParameters (string key)
 Converts map element into an Parameters or returns empty Parameters if conversion is not possible. More...
 
Parameters GetAsParametersWithDefault (string key, Parameters defaultValue)
 Converts map element into an Parameters or returns default value if conversion is not possible. More...
 
new bool ContainsKey (string key)
 Checks if this map contains an element with specified key. More...
 
Parameters Override (Parameters parameters)
 Overrides parameters with new values from specified Parameters and returns a new Parameters object. More...
 
Parameters Override (Parameters parameters, bool recursive)
 Overrides parameters with new values from specified Parameters and returns a new Parameters object. More...
 
Parameters SetDefaults (Parameters defaultParameters)
 Set default values from specified Parameters and returns a new Parameters object. More...
 
Parameters SetDefaults (Parameters defaultParameters, bool recursive)
 Set default values from specified Parameters and returns a new Parameters object. More...
 
void AssignTo (object value)
 Assigns (copies over) properties from the specified value to this map. More...
 
Parameters Pick (params string[] paths)
 Picks select parameters from this Parameters and returns them as a new Parameters object. More...
 
Parameters Omit (params string[] paths)
 Omits selected parameters from this Parameters and returns the rest as a new Parameters object. More...
 
string ToJson ()
 Converts this map to JSON object. More...
 
- Public Member Functions inherited from PipServices3.Commons.Data.AnyValueMap
 AnyValueMap ()
 Creates a new instance of the map and assigns its value. More...
 
 AnyValueMap (IDictionary< string, object > values)
 Creates a new instance of the map and assigns its value. More...
 
 AnyValueMap (IDictionary values)
 Creates a new instance of the map and assigns its value. More...
 
void Append (IDictionary< string, object > map)
 Appends new elements to this map. More...
 
void Append (IDictionary map)
 Appends new elements to this map. More...
 
object GetAsObject ()
 Gets the value stored in this map element without any conversions More...
 
object GetAsObject (string key)
 Gets the value stored in map element without any conversions. When element key is not defined it returns the entire map value. More...
 
void SetAsObject (object value)
 Sets a new value for this array element More...
 
void SetAsObject (string key, object value)
 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. More...
 
string GetAsNullableString (string key)
 Converts map element into a string or returns null if conversion is not possible. More...
 
string GetAsString (string key)
 Converts map element into a string or returns "" if conversion is not possible. More...
 
string GetAsStringWithDefault (string key, string defaultValue)
 Converts map element into a string or returns default value if conversion is not possible. More...
 
bool GetAsNullableBoolean (string key)
 Converts map element into a boolean or returns null if conversion is not possible. More...
 
bool GetAsBoolean (string key)
 Converts map element into a boolean or returns false if conversion is not possible. More...
 
bool GetAsBooleanWithDefault (string key, bool defaultValue)
 Converts map element into a boolean or returns default value if conversion is not possible. More...
 
int GetAsNullableInteger (string key)
 Converts map element into an integer or returns null if conversion is not possible. More...
 
int GetAsInteger (string key)
 Converts map element into an integer or returns 0 if conversion is not possible. More...
 
int GetAsIntegerWithDefault (string key, int defaultValue)
 Converts map element into an integer or returns default value if conversion is not possible. More...
 
long GetAsNullableLong (string key)
 Converts map element into a long or returns null if conversion is not possible. More...
 
long GetAsLong (string key)
 Converts map element into a long or returns 0 if conversion is not possible. More...
 
long GetAsLongWithDefault (string key, long defaultValue)
 Converts map element into a long or returns default value if conversion is not possible. More...
 
float GetAsNullableFloat (string key)
 Converts map element into a float or returns null if conversion is not possible. More...
 
float GetAsFloat (string key)
 Converts map element into a float or returns 0 if conversion is not possible. More...
 
float GetAsFloatWithDefault (string key, float defaultValue)
 Converts map element into a float or returns default value if conversion is not possible. More...
 
double GetAsNullableDouble (string key)
 Converts map element into a double or returns null if conversion is not possible. More...
 
double GetAsDouble (string key)
 Converts map element into a double or returns 0 if conversion is not possible. More...
 
double GetAsDoubleWithDefault (string key, double defaultValue)
 Converts map element into a double or returns default value if conversion is not possible. More...
 
DateTime GetAsNullableDateTime (string key)
 Converts map element into a Date or returns null if conversion is not possible. More...
 
DateTime GetAsDateTime (string key)
 Converts map element into a Date or returns current date if conversion is not possible. More...
 
DateTime GetAsDateTimeWithDefault (string key, DateTime? defaultValue)
 Converts map element into a Date or returns default value if conversion is not possible. More...
 
TimeSpan GetAsNullableTimeSpan (string key)
 
TimeSpan GetAsTimeSpan (string key)
 
TimeSpan GetAsTimeSpanWithDefault (string key, TimeSpan? defaultValue)
 
GetAsNullableEnum< T > (string key)
 
GetAsEnum< T > (string key)
 
GetAsEnumWithDefault< T > (string key, T defaultValue)
 
GetAsType< T > (string key)
 Converts map element into a value defined by specied typecode. If conversion is not possible it returns default value for the specied typecode. More...
 
GetAsNullableType< T > (string key)
 Converts map element into a value defined by specied typecode. If conversion is not possible it returns null. More...
 
GetAsTypeWithDefault< T > (string key, T defaultValue)
 Converts map element into a value defined by specied typecode. If conversion is not possible it returns default value. More...
 
AnyValue GetAsValue (string key)
 Converts map element into an AnyValue or returns an empty AnyValue if conversion is not possible. More...
 
AnyValueArray GetAsNullableArray (string key)
 Converts map element into an AnyValueArray or returns null if conversion is not possible. More...
 
AnyValueArray GetAsArray (string key)
 Converts map element into an AnyValueArray or returns empty AnyValueArray if conversion is not possible. More...
 
AnyValueArray GetAsArrayWithDefault (string key, AnyValueArray defaultValue)
 Converts map element into an AnyValueArray or returns default value if conversion is not possible. More...
 
AnyValueMap GetAsNullableMap (string key)
 Converts map element into an AnyValueMap or returns null if conversion is not possible. More...
 
AnyValueMap GetAsMap (string key)
 Converts map element into an AnyValueMap or returns empty AnyValueMap if conversion is not possible. More...
 
AnyValueMap GetAsMapWithDefault (string key, AnyValueMap defaultValue)
 Converts map element into an AnyValueMap or returns default value if conversion is not possible. More...
 
object Clone ()
 Creates a binary clone of this object. More...
 

Static Public Member Functions

static new Parameters FromTuples (params object[] tuples)
 Creates a new Parameters object filled with provided key-value pairs called tuples.Tuples parameters contain a sequence of key1, value1, key2, value2, ... pairs. More...
 
static Parameters MergeParams (params Parameters[] parameters)
 Merges two or more Parameters into one. The following Parameters override previously defined parameters. More...
 
static Parameters FromJson (string json)
 Creates new Parameters from JSON object. More...
 
static Parameters FromConfig (ConfigParams config)
 Creates new Parameters from ConfigMap object. More...
 
- Static Public Member Functions inherited from PipServices3.Commons.Data.AnyValueMap
static AnyValueMap FromValue (object value)
 Converts specified value into AnyValueMap. More...
 
static AnyValueMap FromTuples (params object[] tuples)
 Creates a new AnyValueMap from a list of key-value pairs called tuples. More...
 
static AnyValueMap FromMaps (params IDictionary[] maps)
 Creates a new AnyValueMap by merging two or more maps. Maps defined later in the list override values from previously defined maps. More...
 

Additional Inherited Members

- Properties inherited from PipServices3.Commons.Data.AnyValueMap
new object this[string key] [get, set]
 

Detailed Description

Contains map with execution parameters.

In general, this map may contain non-serializable values. And in contrast with other maps, its getters and setters support dot notation and able to access properties in the entire object graph.

This class is often use to pass execution and notification arguments, and parameterize classes before execution.

See IParameterized, AnyValueMap

Constructor & Destructor Documentation

◆ Parameters() [1/2]

PipServices3.Commons.Run.Parameters.Parameters ( )

Creates a new instance of the map.

◆ Parameters() [2/2]

PipServices3.Commons.Run.Parameters.Parameters ( IDictionary  values)

Creates a new instance of the map and assigns its value.

Parameters
values(optional) values to initialize this map.

Member Function Documentation

◆ AssignTo()

void PipServices3.Commons.Run.Parameters.AssignTo ( object  value)

Assigns (copies over) properties from the specified value to this map.

Parameters
valuevalue whose properties shall be copied over.

See RecursiveObjectWriter.CopyProperties(object, object)

◆ ContainsKey()

new bool PipServices3.Commons.Run.Parameters.ContainsKey ( string  key)

Checks if this map contains an element with specified key.

The key can be defined using dot notation and allows to recursively access elements of elements.

Parameters
keya key to be checked
Returns
true if this map contains the key or false otherwise.

◆ FromConfig()

static Parameters PipServices3.Commons.Run.Parameters.FromConfig ( ConfigParams  config)
static

Creates new Parameters from ConfigMap object.

Parameters
configa ConfigParams that contain parameters.
Returns
a new Parameters object.

See ConfigParams

◆ FromJson()

static Parameters PipServices3.Commons.Run.Parameters.FromJson ( string  json)
static

Creates new Parameters from JSON object.

Parameters
jsona JSON string containing parameters.
Returns
a new Parameters object.

See JsonConverter.ToNullableMap(string)

◆ FromTuples()

static new Parameters PipServices3.Commons.Run.Parameters.FromTuples ( params object []  tuples)
static

Creates a new Parameters object filled with provided key-value pairs called tuples.Tuples parameters contain a sequence of key1, value1, key2, value2, ... pairs.

Parameters
tuplesthe tuples to fill a new Parameters object.
Returns
a new Parameters object.

See AnyValueMap.FromTuples(object[])

◆ Get()

override object PipServices3.Commons.Run.Parameters.Get ( string  path)
virtual

Gets a map element specified by its key.

The key can be defined using dot notation and allows to recursively access elements of elements.

Parameters
patha key of the element to get.
Returns
the value of the map element.

Reimplemented from PipServices3.Commons.Data.AnyValueMap.

◆ GetAsNullableParameters()

Parameters PipServices3.Commons.Run.Parameters.GetAsNullableParameters ( string  key)

Converts map element into an Parameters or returns null if conversion is not possible.

Parameters
keya key of element to get.
Returns
Parameters value of the element or null if conversion is not supported.

◆ GetAsParameters()

Parameters PipServices3.Commons.Run.Parameters.GetAsParameters ( string  key)

Converts map element into an Parameters or returns empty Parameters if conversion is not possible.

Parameters
keya key of element to get.
Returns
Parameters value of the element or empty Parameters if conversion is not supported.

◆ GetAsParametersWithDefault()

Parameters PipServices3.Commons.Run.Parameters.GetAsParametersWithDefault ( string  key,
Parameters  defaultValue 
)

Converts map element into an Parameters or returns default value if conversion is not possible.

Parameters
keya key of element to get.
defaultValuethe default value
Returns
Parameters value of the element or default value if conversion is not supported.

◆ MergeParams()

static Parameters PipServices3.Commons.Run.Parameters.MergeParams ( params Parameters []  parameters)
static

Merges two or more Parameters into one. The following Parameters override previously defined parameters.

Parameters
parametersa list of Parameters objects to be merged.
Returns
a new Parameters object.

◆ Omit()

Parameters PipServices3.Commons.Run.Parameters.Omit ( params string []  paths)

Omits selected parameters from this Parameters and returns the rest as a new Parameters object.

Parameters
pathskeys to be omitted from copying over to new Parameters.
Returns
a new Parameters object.

◆ Override() [1/2]

Parameters PipServices3.Commons.Run.Parameters.Override ( Parameters  parameters)

Overrides parameters with new values from specified Parameters and returns a new Parameters object.

Parameters
parametersParameters with parameters to override the current values.
Returns
a new Parameters object.

◆ Override() [2/2]

Parameters PipServices3.Commons.Run.Parameters.Override ( Parameters  parameters,
bool  recursive 
)

Overrides parameters with new values from specified Parameters and returns a new Parameters object.

Parameters
parametersParameters with parameters to override the current values.
recursive(optional) true to perform deep copy, and false for shallow copy.Default: false
Returns
a new Parameters object.

◆ Pick()

Parameters PipServices3.Commons.Run.Parameters.Pick ( params string []  paths)

Picks select parameters from this Parameters and returns them as a new Parameters object.

Parameters
pathskeys to be picked and copied over to new Parameters.
Returns
a new Parameters object.

◆ Set()

override void PipServices3.Commons.Run.Parameters.Set ( string  path,
object  value 
)
virtual

Sets a new value into map element specified by its key.

The key can be defined using dot notation and allows to recursively access elements of elements.

Parameters
patha path of the element to set.
valuea new value for map element.

Reimplemented from PipServices3.Commons.Data.AnyValueMap.

◆ SetDefaults() [1/2]

Parameters PipServices3.Commons.Run.Parameters.SetDefaults ( Parameters  defaultParameters)

Set default values from specified Parameters and returns a new Parameters object.

Parameters
defaultParametersParameters with default parameter values.
Returns
a new Parameters object.

◆ SetDefaults() [2/2]

Parameters PipServices3.Commons.Run.Parameters.SetDefaults ( Parameters  defaultParameters,
bool  recursive 
)

Set default values from specified Parameters and returns a new Parameters object.

Parameters
defaultParametersParameters with default parameter values.
recursive(optional) true to perform deep copy, and false for shallow copy.Default: false
Returns
a new Parameters object.

◆ ToJson()

string PipServices3.Commons.Run.Parameters.ToJson ( )

Converts this map to JSON object.

Returns
a JSON representation of this map.

See JsonConverter.ToJson(object)


The documentation for this class was generated from the following file: