Class DefaultCouponCodesGenerator
java.lang.Object
de.hybris.platform.couponservices.couponcodegeneration.impl.DefaultCouponCodesGenerator
- All Implemented Interfaces:
CouponCodesGenerator,org.springframework.beans.factory.InitializingBean
public class DefaultCouponCodesGenerator
extends Object
implements CouponCodesGenerator, org.springframework.beans.factory.InitializingBean
Default implementation of
CouponCodesGenerator interface-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerate next coupon code in the batchprotected CouponCodeCipherTextGenerationStrategyprotected CouponCodeClearTextGenerationStrategyreturns the ratio of clear-text to cipher-text based on total length of the coupon code.protected StringinsertCodeSeparators(String generatedCode, MultiCodeCouponModel coupon) protected StringvoidsetCipherTextStrategy(CouponCodeCipherTextGenerationStrategy cipherTextStrategy) voidsetClearTextStrategy(CouponCodeClearTextGenerationStrategy clearTextStrategy) voidsetCodeLengthMapping(Map<Integer, Integer> codeLengthMapping)
-
Constructor Details
-
DefaultCouponCodesGenerator
public DefaultCouponCodesGenerator()
-
-
Method Details
-
generateNextCouponCode
Description copied from interface:CouponCodesGeneratorgenerate next coupon code in the batch- Specified by:
generateNextCouponCodein interfaceCouponCodesGenerator- Parameters:
coupon- instance ofMultiCodeCouponModelto generate coupons for- Returns:
- next coupon code, null otherwise
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
insertCodeSeparators
-
printCodeLengths
-
getClearTextStrategy
-
setClearTextStrategy
-
getCipherTextStrategy
-
setCipherTextStrategy
-
setCodeLengthMapping
-
getCodeLengthMapping
Description copied from interface:CouponCodesGeneratorreturns the ratio of clear-text to cipher-text based on total length of the coupon code.key: coupon code length. value: clear-text length. implicit: cipher-text length = (key - value)
- Specified by:
getCodeLengthMappingin interfaceCouponCodesGenerator
-