Class sap.ushell.services.Personalization.VariantModule: sap/ushell/services/Personalization


The personalization variant contains personalization data. It is used in the personalization container mode.


Since: 1.22.0.
Constructor Summary
new sap.ushell.services.Personalization.Variant()To be instantiated via Personalization.VariantSet add / get Variant only
Method Summary
containsItem(sItemKey)Checks if a specific item is contained in this variant.
delItem(sItemKey)Deletes an item from this variant.
getItemKeys()Returns an array with the keys of all items in this variant.
getItemValue(sItemKey)Returns the value for an item in this variant.
getVariantKey()Returns the key of this variant.
getVariantName()Returns the name of this variant.
setItemValue(sItemKey, item)Sets the value for an item in this variant.
setVariantName(sVariantName)Sets the name of the variant.
Constructor Detail
new sap.ushell.services.Personalization.Variant()
To be instantiated via Personalization.VariantSet add / get Variant only
Method Detail
containsItem(sItemKey): boolean
Checks if a specific item is contained in this variant.
Parameters:
{string}sItemKey item key
Since:
1.18.0
Returns:
{boolean}true if the variant contains an item with the key
delItem(sItemKey)
Deletes an item from this variant. In case the item does not exist, nothing happens.
Parameters:
{string}sItemKey item key
Since:
1.22.0
getItemKeys(): array
Returns an array with the keys of all items in this variant.
Since:
1.22.0
Returns:
{array} item keys
getItemValue(sItemKey): object
Returns the value for an item in this variant.
Parameters:
{string}sItemKey item key
Since:
1.18.0
Returns:
{object} item value (JSON object). In case the variant does not contain an item with this key undefined is returned.
getVariantKey(): string
Returns the key of this variant.
Since:
1.22.0
Returns:
{string} variant key.
getVariantName(): string
Returns the name of this variant.
Since:
1.22.0
Returns:
{string} variant name.
setItemValue(sItemKey, item)
Sets the value for an item in this variant.
Parameters:
{string}sItemKey item key
{object}item value (JSON object)
Since:
1.18.0
setVariantName(sVariantName)
Sets the name of the variant.

In case a variant with sVariantName is already existing in the corresponding variant set an exception is thrown.

Parameters:
{string}sVariantName variant name
Since:
1.24.0