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


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


Since: 1.22.0.
Constructor Summary
new sap.ushell.services.Personalization.VariantSet()A VariantSet is a class representing a collection of Variants (identified by a key and name) and a member variable indicating the "current variable"

When manipulating the underlying data, additional constraints are enforced.

Method Summary
addVariant(sVariantSetName)Creates a new variant in the variant set.
containsVariant(sVariantKey)Checks if a specific variant is contained in the variant set.
delVariant(sVariantKey)Deletes a variant from the variant set.
getCurrentVariantKey()Returns the current variant key.
getVariant(sVariantKey)Returns a variant object.
getVariantKeyByName(sVariantName)Returns the variant key corresponding to a variant name.
getVariantKeys()Returns an array with the keys of the variants in the variant set.
setCurrentVariantKey(sVariantKey)Sets the current variant key.
Constructor Detail
new sap.ushell.services.Personalization.VariantSet()
A VariantSet is a class representing a collection of Variants (identified by a key and name) and a member variable indicating the "current variable"

When manipulating the underlying data, additional constraints are enforced.

To be called by the personalization container.

Method Detail
addVariant(sVariantSetName): object
Creates a new variant in the variant set. In case a variant with this name is already existing an exception is thrown.
Parameters:
{string}sVariantSetName variant set name
Since:
1.22.0
Returns:
{object}sap.ushell.services.PersonalizationContainerVariant
containsVariant(sVariantKey): boolean
Checks if a specific variant is contained in the variant set.
Parameters:
{string}sVariantKey variant key
Since:
1.22.0
Returns:
{boolean}true if the variant set contains a variant with the key
delVariant(sVariantKey)
Deletes a variant from the variant set. In case the variant does not exist nothing happens.
Parameters:
{string}sVariantKey variant key
Since:
1.22.0
getCurrentVariantKey(): string
Returns the current variant key.
Since:
1.22.0
Returns:
{string} current variant key. In case the current variant was never set null is returned.
getVariant(sVariantKey): object
Returns a variant object.
Parameters:
{string}sVariantKey variant key
Since:
1.22.0
Returns:
{object}sap.ushell.services.PersonalizationContainerVariant. In case the variant set does not contain a variant with this key undefined is returned.
getVariantKeyByName(sVariantName): string
Returns the variant key corresponding to a variant name.
Parameters:
{string}sVariantName variant name
Since:
1.22.0
Returns:
{string} variant key. In case the variant set does not contain a variant with this name undefined is returned.
getVariantKeys(): array
Returns an array with the keys of the variants in the variant set.
Since:
1.22.0
Returns:
{array} variant keys
setCurrentVariantKey(sVariantKey)
Sets the current variant key.
Parameters:
{string}sVariantKey There is no validity check for the variant key.
Since:
1.22.0