Class AbstractCouponCodeGenerationStrategy
java.lang.Object
de.hybris.platform.couponservices.couponcodegeneration.impl.AbstractCouponCodeGenerationStrategy
- Direct Known Subclasses:
DefaultCouponCodeCipherTextGenerationStrategy,DefaultCouponCodeClearTextGenerationStrategy
Abstract base class for the default coupon code generation strategies
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intcreateIntFromTwoCharactersString(String value, int offset, String alphabet) this is the inverse function tocreateTwoCharactersFromByte(int, int, String): If given a two-character inputvalueand the offset used to create the two character input it will derive the originating int (byte) used to create this string.protected StringcreateTwoCharactersFromByte(int value, int offset, String alphabet) creates a two-character string from the given int valueprotected StringpickCharacter(int value, int offset, String alphabet) returns a one-character string from the given alphabet.protected intThis is the inverse function topickCharacter(int, int, String): For the the given charvalueit will derive the originating int and return it.
-
Constructor Details
-
AbstractCouponCodeGenerationStrategy
public AbstractCouponCodeGenerationStrategy()
-
-
Method Details
-
createTwoCharactersFromByte
creates a two-character string from the given int value -
pickCharacter
returns a one-character string from the given alphabet. The value and offset are used to lookup the character from the alphabet. -
createIntFromTwoCharactersString
this is the inverse function tocreateTwoCharactersFromByte(int, int, String): If given a two-character inputvalueand the offset used to create the two character input it will derive the originating int (byte) used to create this string. -
pickInt
This is the inverse function topickCharacter(int, int, String): For the the given charvalueit will derive the originating int and return it.
-