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