Class AbstractCouponCodeGenerationStrategy

java.lang.Object
de.hybris.platform.couponservices.couponcodegeneration.impl.AbstractCouponCodeGenerationStrategy
Direct Known Subclasses:
DefaultCouponCodeCipherTextGenerationStrategy, DefaultCouponCodeClearTextGenerationStrategy

public abstract class AbstractCouponCodeGenerationStrategy extends Object
Abstract base class for the default coupon code generation strategies
  • Constructor Details

    • AbstractCouponCodeGenerationStrategy

      public AbstractCouponCodeGenerationStrategy()
  • Method Details

    • createTwoCharactersFromByte

      protected String createTwoCharactersFromByte(int value, int offset, String alphabet)
      creates a two-character string from the given int value
    • pickCharacter

      protected String pickCharacter(int value, int offset, 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(String value, int offset, String alphabet)
      this is the inverse function to createTwoCharactersFromByte(int, int, String): If given a two-character input value 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, String alphabet)
      This is the inverse function to pickCharacter(int, int, String): For the the given char value it will derive the originating int and return it.