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.StringINSTANCE_SEPERATORInstance key consists of name and id, which are separated by this sepperator.static java.lang.StringKEY_SEPARATORSeparator 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.StringgenerateCsticId(CsticModel model, CsticValueModel value, java.lang.String prefix)Generates a Unique Key for a cstic, o a cstic value, if provided.java.lang.StringgenerateGroupIdForGroup(InstanceModel instance, CsticGroup csticModelGroup)java.lang.StringgenerateGroupIdForInstance(InstanceModel instance)java.lang.StringgenerateId(CsticQualifier csticQualifier)creates a cstic ui key from the provided componentsprotected java.lang.StringBuildergetStrBuilder()protected static java.lang.StringBuilderinitialValue()java.lang.StringretrieveInstanceId(java.lang.String uiGroupId)CsticQualifiersplitId(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:
generateGroupIdForInstancein 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:
generateGroupIdForGroupin 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:
retrieveInstanceIdin 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:UniqueUIKeyGeneratorGenerates a Unique Key for a cstic, o a cstic value, if provided.- Specified by:
generateCsticIdin interfaceUniqueUIKeyGenerator- Parameters:
model- cstic modelvalue- cstic value model. Ifnullthe key is only specific for the csticprefix- 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:UniqueUIKeyGeneratorsplits the given cstic UI key into its components- Specified by:
splitIdin interfaceUniqueUIKeyGenerator- Returns:
- a csticQualifier
-
generateId
public java.lang.String generateId(CsticQualifier csticQualifier)
Description copied from interface:UniqueUIKeyGeneratorcreates a cstic ui key from the provided components- Specified by:
generateIdin interfaceUniqueUIKeyGenerator- Returns:
- unique Key
-
-