Products Downloads


French version


 

This function adds one or more key/value pairs to a Hash-type object.

For each pair, the key becomes an attribute name and the value becomes the value associated with the attribute.

The Hash object passed as a parameter must be an object created by the "createSimpleHash" function.

 

Parameters

Hash

addToThisHash

Hash object to add one or more attributes to

Mandatory

Hash
/
String

copiedHash
/
key

All the copiedHash attributes are added to addToThisHash.
Name of attribute to add to addToThisHash

Optional

All types

Value

Value associated with the attribute called "key" in addToThisHash

Optional. Mandatory if the second parameter is String type

 


For example

<#assign addToThisHash = hardisCore.createSimpleHash() />
<#assign copiedHash = {"attr1": 1, "attr2":true} />
<#-- Add hash content to addToThisHash -->
<#assign noUse = hardisCore.addToSimpleHash(addToThisHash , copiedHash) />
Size of addToThisHash:${ addToThisHash?keys?size}
<#-- Add key / value couple -->
<#assign noUse = hardisCore.addToSimpleHash(addToThisHash, "newAttribute", "newValue") />
Size of addToThisHash:${ addToThisHash?keys?size}