Class UniqueKeyGeneratorImpl
java.lang.Object
de.hybris.platform.sap.productconfig.runtime.interf.services.impl.UniqueKeyGeneratorImpl
- All Implemented Interfaces:
UniqueKeyGenerator
Default implementation of the
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.
UniqueKeyGenerator.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
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractInstanceNameFromGroupId(String groupId) generateCsticId(CsticModel model, CsticValueModel value, String prefix) Generates a Unique Key for a cstic, o a cstic value, if provided.generateGroupIdForGroup(InstanceModel instance, CsticGroup csticModelGroup) generateGroupIdForInstance(InstanceModel instance) generateId(CsticQualifier csticQualifier) creates a cstic ui key from the provided componentsprotected StringBuilderprotected static StringBuilderretrieveGroupName(String uiGroupId) retrieveInstanceId(String uiGroupId) splits the given cstic UI key into its components
-
Field Details
-
MINIMUM_STRING_BUILDER_CAPACITY
public static final int MINIMUM_STRING_BUILDER_CAPACITY- See Also:
-
STRING_BUILDER_CAPACITY_THRESHOLD
public static final int STRING_BUILDER_CAPACITY_THRESHOLD- See Also:
-
EXPECTED_GROUP_PARTS
public static final int EXPECTED_GROUP_PARTS- See Also:
-
EXPECTED_INSTANCE_PARTS
public static final int EXPECTED_INSTANCE_PARTS- See Also:
-
-
Constructor Details
-
UniqueKeyGeneratorImpl
public UniqueKeyGeneratorImpl()
-
-
Method Details
-
initialValue
-
generateGroupIdForInstance
- Specified by:
generateGroupIdForInstancein interfaceUniqueKeyGenerator- Parameters:
instance- instance data- Returns:
- unique key for a UIGroup representing an Instance
-
generateGroupIdForGroup
- Specified by:
generateGroupIdForGroupin interfaceUniqueKeyGenerator- Parameters:
instance- instance the group belongs tocsticModelGroup- group data- Returns:
- unique key for a UIGroup representing an Group
-
retrieveInstanceId
- Specified by:
retrieveInstanceIdin interfaceUniqueKeyGenerator- Parameters:
uiGroupId- UIGroup id- Returns:
- extract instance id from the UIGroup Id
-
generateCsticId
Description copied from interface:UniqueKeyGeneratorGenerates a Unique Key for a cstic, o a cstic value, if provided.- Specified by:
generateCsticIdin interfaceUniqueKeyGenerator- 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
-
splitId
Description copied from interface:UniqueKeyGeneratorsplits the given cstic UI key into its components- Specified by:
splitIdin interfaceUniqueKeyGenerator- Returns:
- a csticQualifier
-
generateId
Description copied from interface:UniqueKeyGeneratorcreates a cstic ui key from the provided components- Specified by:
generateIdin interfaceUniqueKeyGenerator- Returns:
- unique Key
-
extractInstanceNameFromGroupId
- Specified by:
extractInstanceNameFromGroupIdin interfaceUniqueKeyGenerator- Parameters:
groupId- group id- Returns:
- extracted instance name from group id
-
retrieveGroupName
- Specified by:
retrieveGroupNamein interfaceUniqueKeyGenerator- Parameters:
uiGroupId- UIGroup id- Returns:
- extract group name from the UIGroup Id
-
getInstanceSeparator
- Specified by:
getInstanceSeparatorin interfaceUniqueKeyGenerator- Returns:
- the instance separator
-
getKeySeparator
- Specified by:
getKeySeparatorin interfaceUniqueKeyGenerator- Returns:
- the key separator
-
getKeySeparatorSplit
- Specified by:
getKeySeparatorSplitin interfaceUniqueKeyGenerator- Returns:
- the key separator for split statement
-