Class DefaultSegmentationHelper
- java.lang.Object
-
- de.hybris.platform.personalizationfacades.segmentation.impl.DefaultSegmentationHelper
-
- All Implemented Interfaces:
SegmentationHelper
public class DefaultSegmentationHelper extends java.lang.Object implements SegmentationHelper
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_SEPARATORprotected static java.lang.StringNULL_STRING-
Fields inherited from interface de.hybris.platform.personalizationfacades.segmentation.SegmentationHelper
BASESITE_INDEX, CUSTOMER_INDEX, NUMBER_OF_CODE_INDEXES, PROVIDER_INDEX, SEGMENT_INDEX
-
-
Constructor Summary
Constructors Constructor Description DefaultSegmentationHelper()DefaultSegmentationHelper(java.lang.String seperator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String[]decode(java.lang.String[] codes)protected java.lang.Stringencode(java.lang.String segmentId, java.lang.String relatedObjectId, java.lang.String baseSite, java.lang.String provider)java.lang.StringgetCustomerSegmentationCode(CxUserToSegmentModel userSegment)Generate customer segmentation codejava.lang.StringgetSegmentationCode(java.lang.String... parameters)Generate customer segmentation codeprotected java.lang.String[]split(java.lang.String code)java.lang.String[]splitCustomerSegmentationCode(java.lang.String segmentationId)java.lang.StringvalidateSegmentationCode(java.lang.String code)Method validates segmentation code and returns error message if code is incorrect.
-
-
-
Field Detail
-
DEFAULT_SEPARATOR
public static final java.lang.String DEFAULT_SEPARATOR
- See Also:
- Constant Field Values
-
NULL_STRING
protected static final java.lang.String NULL_STRING
-
-
Method Detail
-
getSegmentationCode
public java.lang.String getSegmentationCode(java.lang.String... parameters)
Description copied from interface:SegmentationHelperGenerate customer segmentation code- Specified by:
getSegmentationCodein interfaceSegmentationHelper- Parameters:
parameters- parameters needed to create segmentation code like : user identifier, segment code, basesite identifier, provider identifier. Indexes used to read parameters :SegmentationHelper.CUSTOMER_INDEX,SegmentationHelper.SEGMENT_INDEX,SegmentationHelper.BASESITE_INDEX,SegmentationHelper.PROVIDER_INDEX- Returns:
- customer segmentation code
-
encode
protected java.lang.String encode(java.lang.String segmentId, java.lang.String relatedObjectId, java.lang.String baseSite, java.lang.String provider)
-
getCustomerSegmentationCode
public java.lang.String getCustomerSegmentationCode(CxUserToSegmentModel userSegment)
Description copied from interface:SegmentationHelperGenerate customer segmentation code- Specified by:
getCustomerSegmentationCodein interfaceSegmentationHelper- Parameters:
userSegment- relation beetween customer and segment- Returns:
- customer segmentation code
-
splitCustomerSegmentationCode
public java.lang.String[] splitCustomerSegmentationCode(java.lang.String segmentationId)
- Specified by:
splitCustomerSegmentationCodein interfaceSegmentationHelper
-
split
protected java.lang.String[] split(java.lang.String code)
-
decode
protected java.lang.String[] decode(java.lang.String[] codes)
-
validateSegmentationCode
public java.lang.String validateSegmentationCode(java.lang.String code)
Description copied from interface:SegmentationHelperMethod validates segmentation code and returns error message if code is incorrect.- Specified by:
validateSegmentationCodein interfaceSegmentationHelper- Parameters:
code- Segmentation code- Returns:
- error message
-
-