Class 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 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.
      protected java.lang.String createTwoCharactersFromByte​(int value, int offset, java.lang.String alphabet)
      creates a two-character string from the given int value
      protected 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 to pickCharacter(int, int, String): For the the given char value it will derive the originating int and return it.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractCouponCodeGenerationStrategy

        public AbstractCouponCodeGenerationStrategy()
    • 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 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,
                              java.lang.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.