Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Parameters

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

see

AnyValueMap

Hierarchy

Implements

Index

Constructors

constructor

Methods

append

  • append(map: any): void

assignTo

  • assignTo(value: any): void
  • Assigns (copies over) properties from the specified value to this map.

    Parameters

    • value: any

      value whose properties shall be copied over.

    Returns void

clear

  • clear(): any

clone

  • clone(): any

containsKey

  • containsKey(key: string): boolean
  • 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

    • key: string

      a key to be checked

    Returns boolean

    true if this map contains the key or false otherwise.

get

  • get(key: string): any
  • 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

    • key: string

      a key of the element to get.

    Returns any

    the value of the map element.

getAsArray

getAsArrayWithDefault

getAsBoolean

  • getAsBoolean(key: string): boolean

getAsBooleanWithDefault

  • getAsBooleanWithDefault(key: string, defaultValue: boolean): boolean

getAsDateTime

  • getAsDateTime(key: string): Date

getAsDateTimeWithDefault

  • getAsDateTimeWithDefault(key: string, defaultValue: Date): Date

getAsDouble

  • getAsDouble(key: string): number

getAsDoubleWithDefault

  • getAsDoubleWithDefault(key: string, defaultValue: number): number

getAsFloat

  • getAsFloat(key: string): number

getAsFloatWithDefault

  • getAsFloatWithDefault(key: string, defaultValue: number): number

getAsInteger

  • getAsInteger(key: string): number

getAsIntegerWithDefault

  • getAsIntegerWithDefault(key: string, defaultValue: number): number

getAsLong

  • getAsLong(key: string): number

getAsLongWithDefault

  • getAsLongWithDefault(key: string, defaultValue: number): number

getAsMap

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

    see

    fromValue

    Parameters

    • key: string

      a key of element to get.

    Returns AnyValueMap

    AnyValueMap value of the element or empty AnyValueMap if conversion is not supported.

getAsMapWithDefault

getAsNullableArray

getAsNullableBoolean

  • getAsNullableBoolean(key: string): boolean

getAsNullableDateTime

  • getAsNullableDateTime(key: string): Date

getAsNullableDouble

  • getAsNullableDouble(key: string): number

getAsNullableFloat

  • getAsNullableFloat(key: string): number

getAsNullableInteger

  • getAsNullableInteger(key: string): number

getAsNullableLong

  • getAsNullableLong(key: string): number

getAsNullableMap

getAsNullableParameters

  • getAsNullableParameters(key: string): Parameters
  • Converts map element into an Parameters or returns null if conversion is not possible.

    Parameters

    • key: string

      a key of element to get.

    Returns Parameters

    Parameters value of the element or null if conversion is not supported.

getAsNullableString

  • getAsNullableString(key: string): string

getAsNullableType

  • getAsNullableType<T>(type: TypeCode, key: string): T
  • Converts map element into a value defined by specied typecode. If conversion is not possible it returns null.

    see

    TypeConverter.toNullableType

    Type parameters

    • T

    Parameters

    • type: TypeCode

      the TypeCode that defined the type of the result

    • key: string

      a key of element to get.

    Returns T

    element value defined by the typecode or null if conversion is not supported.

getAsObject

  • getAsObject(key?: string): any
  • Gets the value stored in map element without any conversions. When element key is not defined it returns the entire map value.

    Parameters

    • Default value key: string = undefined

      (optional) a key of the element to get

    Returns any

    the element value or value of the map when index is not defined.

getAsParameters

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

    Parameters

    • key: string

      a key of element to get.

    Returns Parameters

    Parameters value of the element or empty Parameters if conversion is not supported.

getAsParametersWithDefault

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

    Parameters

    • key: string

      a key of element to get.

    • defaultValue: Parameters

      the default value

    Returns Parameters

    Parameters value of the element or default value if conversion is not supported.

getAsString

  • getAsString(key: string): string

getAsStringWithDefault

  • getAsStringWithDefault(key: string, defaultValue: string): string

getAsType

  • getAsType<T>(type: TypeCode, key: string): T
  • Converts map element into a value defined by specied typecode. If conversion is not possible it returns default value for the specified type.

    see

    getAsTypeWithDefault

    Type parameters

    • T

    Parameters

    • type: TypeCode

      the TypeCode that defined the type of the result

    • key: string

      a key of element to get.

    Returns T

    element value defined by the typecode or default if conversion is not supported.

getAsTypeWithDefault

  • getAsTypeWithDefault<T>(type: TypeCode, key: string, defaultValue: T): T
  • Converts map element into a value defined by specied typecode. If conversion is not possible it returns default value.

    see

    TypeConverter.toTypeWithDefault

    Type parameters

    • T

    Parameters

    • type: TypeCode

      the TypeCode that defined the type of the result

    • key: string

      a key of element to get.

    • defaultValue: T

      the default value

    Returns T

    element value defined by the typecode or default value if conversion is not supported.

getAsValue

getKeys

  • getKeys(): string[]

length

  • length(): number

omit

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

    Parameters

    • Rest ...paths: string[]

      keys to be omitted from copying over to new Parameters.

    Returns Parameters

    a new Parameters object.

override

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

    see

    setDefaults

    Parameters

    • parameters: Parameters

      Parameters with parameters to override the current values.

    • Default value recursive: boolean = false

      (optional) true to perform deep copy, and false for shallow copy. Default: false

    Returns Parameters

    a new Parameters object.

pick

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

    Parameters

    • Rest ...paths: string[]

      keys to be picked and copied over to new Parameters.

    Returns Parameters

    a new Parameters object.

put

  • put(key: string, value: any): any
  • Puts 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

    • key: string

      a key of the element to put.

    • value: any

      a new value for map element.

    Returns any

remove

  • remove(key: string): void

setAsObject

  • setAsObject(key: any, value?: any): void
  • 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.

    see

    MapConverter.toMap

    Parameters

    • key: any

      (optional) a key of the element to set

    • Default value value: any = undefined

      a new element or map value.

    Returns void

setDefaults

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

    see

    override

    Parameters

    • defaultParameters: Parameters

      Parameters with default parameter values.

    • Default value recursive: boolean = false

      (optional) true to perform deep copy, and false for shallow copy. Default: false

    Returns Parameters

    a new Parameters object.

toJson

  • toJson(): string
  • Converts this map to JSON object.

    Returns string

    a JSON representation of this map.

toString

  • toString(): string
  • 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"

    Returns string

    a string representation of the object.

Static fromConfig

Static fromJson

Static fromMaps

  • Creates a new AnyValueMap by merging two or more maps. Maps defined later in the list override values from previously defined maps.

    Parameters

    • Rest ...maps: any[]

      an array of maps to be merged

    Returns AnyValueMap

    a newly created AnyValueMap.

Static fromTuples

Static fromTuplesArray

  • Creates a new AnyValueMap from a list of key-value pairs called tuples. The method is similar to fromTuples but tuples are passed as array instead of parameters.

    Parameters

    • tuples: any[]

      a list of values where odd elements are keys and the following even elements are values

    Returns AnyValueMap

    a newly created AnyValueArray.

Static fromValue

  • Creates a new Parameters object filled with key-value pairs from specified object.

    Parameters

    • value: any

      an object with key-value pairs used to initialize a new Parameters.

    Returns Parameters

    a new Parameters object.

Static mergeParams

Generated using TypeDoc