public class DefaultCouponCodesGenerator extends Object implements CouponCodesGenerator
CouponCodesGenerator interface| Constructor and Description |
|---|
DefaultCouponCodesGenerator() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
String |
generateNextCouponCode(MultiCodeCouponModel coupon)
generate next coupon code in the batch
|
protected CouponCodeCipherTextGenerationStrategy |
getCipherTextStrategy() |
protected CouponCodeClearTextGenerationStrategy |
getClearTextStrategy() |
Map<Integer,Integer> |
getCodeLengthMapping()
returns the ratio of clear-text to cipher-text based on total length of the coupon code.
|
protected String |
insertCodeSeparators(String generatedCode,
MultiCodeCouponModel coupon) |
protected String |
printCodeLengths() |
void |
setCipherTextStrategy(CouponCodeCipherTextGenerationStrategy cipherTextStrategy) |
void |
setClearTextStrategy(CouponCodeClearTextGenerationStrategy clearTextStrategy) |
void |
setCodeLengthMapping(Map<Integer,Integer> codeLengthMapping) |
public String generateNextCouponCode(MultiCodeCouponModel coupon)
CouponCodesGeneratorgenerateNextCouponCode in interface CouponCodesGeneratorcoupon - instance of MultiCodeCouponModel to generate coupons forpublic void afterPropertiesSet()
protected String insertCodeSeparators(String generatedCode, MultiCodeCouponModel coupon)
protected String printCodeLengths()
protected CouponCodeClearTextGenerationStrategy getClearTextStrategy()
public void setClearTextStrategy(CouponCodeClearTextGenerationStrategy clearTextStrategy)
protected CouponCodeCipherTextGenerationStrategy getCipherTextStrategy()
public void setCipherTextStrategy(CouponCodeCipherTextGenerationStrategy cipherTextStrategy)
public Map<Integer,Integer> getCodeLengthMapping()
CouponCodesGeneratorkey: coupon code length. value: clear-text length. implicit: cipher-text length = (key - value)
getCodeLengthMapping in interface CouponCodesGeneratorCopyright © 2017 SAP SE. All Rights Reserved.