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