Class UniqueUIKeyGeneratorImpl
- java.lang.Object
-
- de.hybris.platform.sap.productconfig.facades.impl.UniqueUIKeyGeneratorImpl
-
- All Implemented Interfaces:
UniqueUIKeyGenerator
public class UniqueUIKeyGeneratorImpl extends java.lang.Object implements UniqueUIKeyGenerator
Default implementation of theUniqueUIKeyGenerator
.
Re-Uses a single StringBuilder instance per thread to save heap memory. This class gets called quite often within a single requests, up to a few million times for large models.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
INSTANCE_SEPERATOR
Instance key consists of name and id, which are separated by this sepperator.static java.lang.String
KEY_SEPARATOR
Separator for UIKey componets, such as Instance, group and cstic key.
-
Constructor Summary
Constructors Constructor Description UniqueUIKeyGeneratorImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
generateCsticId(CsticModel model, CsticValueModel value, java.lang.String prefix)
Generates a Unique Key for a cstic, o a cstic value, if provided.java.lang.String
generateGroupIdForGroup(InstanceModel instance, CsticGroup csticModelGroup)
java.lang.String
generateGroupIdForInstance(InstanceModel instance)
java.lang.String
generateId(CsticQualifier csticQualifier)
creates a cstic ui key from the provided componentsprotected java.lang.StringBuilder
getStrBuilder()
protected static java.lang.StringBuilder
initialValue()
java.lang.String
retrieveInstanceId(java.lang.String uiGroupId)
CsticQualifier
splitId(java.lang.String csticUiKey)
splits the given cstic UI key into its components
-
-
-
Field Detail
-
KEY_SEPARATOR
public static final java.lang.String KEY_SEPARATOR
Separator for UIKey componets, such as Instance, group and cstic key.- See Also:
- Constant Field Values
-
INSTANCE_SEPERATOR
public static final java.lang.String INSTANCE_SEPERATOR
Instance key consists of name and id, which are separated by this sepperator.- See Also:
- Constant Field Values
-
-
Method Detail
-
initialValue
protected static java.lang.StringBuilder initialValue()
-
generateGroupIdForInstance
public java.lang.String generateGroupIdForInstance(InstanceModel instance)
- Specified by:
generateGroupIdForInstance
in interfaceUniqueUIKeyGenerator
- Parameters:
instance
- instance data- Returns:
- unique key for a UIGroup representing an Instance
-
generateGroupIdForGroup
public java.lang.String generateGroupIdForGroup(InstanceModel instance, CsticGroup csticModelGroup)
- Specified by:
generateGroupIdForGroup
in interfaceUniqueUIKeyGenerator
- Parameters:
instance
- instance the group belongs tocsticModelGroup
- group data- Returns:
- unique key for a UIGroup representing an Group
-
retrieveInstanceId
public java.lang.String retrieveInstanceId(java.lang.String uiGroupId)
- Specified by:
retrieveInstanceId
in interfaceUniqueUIKeyGenerator
- Parameters:
uiGroupId
- UIGroup id- Returns:
- extract instance id from the UIGroup Id
-
generateCsticId
public java.lang.String generateCsticId(CsticModel model, CsticValueModel value, java.lang.String prefix)
Description copied from interface:UniqueUIKeyGenerator
Generates a Unique Key for a cstic, o a cstic value, if provided.- Specified by:
generateCsticId
in interfaceUniqueUIKeyGenerator
- Parameters:
model
- cstic modelvalue
- cstic value model. Ifnull
the key is only specific for the cstic
prefix
- key prefix containing group and/or instance components- Returns:
- unique key
-
getStrBuilder
protected java.lang.StringBuilder getStrBuilder()
-
splitId
public CsticQualifier splitId(java.lang.String csticUiKey)
Description copied from interface:UniqueUIKeyGenerator
splits the given cstic UI key into its components- Specified by:
splitId
in interfaceUniqueUIKeyGenerator
- Returns:
- a csticQualifier
-
generateId
public java.lang.String generateId(CsticQualifier csticQualifier)
Description copied from interface:UniqueUIKeyGenerator
creates a cstic ui key from the provided components- Specified by:
generateId
in interfaceUniqueUIKeyGenerator
- Returns:
- unique Key
-
-