Skip to main content
Skip table of contents

HashBuilderModel

Builder pattern for the construction of hash-models.

implements: hash
bundle: online channel standard (oc)
since 4.6.0
Builder pattern for the construction of hash-models.

The HashBuilder represents a mutable map of strings to TemplateModel objects, on which basis immutable FreeMarker hashes can be generated. HashBuilder instances can be created using CenshareNamespace.

Defined hash keys

keys ↦ sequence<String>
since 4.6.0
Returns a sequence of keys used by the model.

size ↦ Integer
since 4.6.0
Returns number of entries in hash-model

toHash ↦ TemplateHashModel
since 4.6.0
Returns a generated hash-model containing the key-value pairs contained in the HashBuilder at the time of the invocation.

values ↦ sequence<TemplateModel>
since 4.6.0
Returns the set of stored values

Methods

clear()HashBuilderModel
since 4.9.1
clears the HashBuilder and returns the HashBuilder instance.

get(String:key)TemplateModel
since 4.6.0
Returns the value stored under 'key' in HashBuilder. The return value is undefined when no corresponding entry exists.

put(String:key, TemplateModel:value)HashBuilderModel
since 4.6.0
Inserts 'code' under 'key' into the HashBuilder and returns the HashBuilder instance.

putAll(TemplateHashModelEx | HashBuilderModel:value)HashBuilderModel
since 5.4.0
Puts all entries of 'value' into the HashBuilder and returns the HashBuilder instance.

remove(String:key)HashBuilderModel
since 4.9.1
Removes 'key' from the HashBuilder and returns the HashBuilder instance.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.