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
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. |