Interface CouponCodesGenerator

  • All Known Implementing Classes:
    DefaultCouponCodesGenerator

    public interface CouponCodesGenerator
    Interface to provide a unique method for generating a batch of coupon codes
    • Method Detail

      • generateNextCouponCode

        java.lang.String generateNextCouponCode​(MultiCodeCouponModel coupon)
        generate next coupon code in the batch
        Parameters:
        coupon - instance of MultiCodeCouponModel to generate coupons for
        Returns:
        next coupon code, null otherwise
      • getCodeLengthMapping

        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.
         key: coupon code length.
         value: clear-text length.
         implicit: cipher-text length = (key - value)