Class CouponWsUtils

java.lang.Object
de.hybris.platform.couponwebservices.util.CouponWsUtils

public class CouponWsUtils extends Object
Some common utility methods.
  • Constructor Details

    • CouponWsUtils

      public CouponWsUtils()
  • Method Details

    • getStringToDateMapper

      public Function<String,Date> getStringToDateMapper()
      Returns mapping function from String (in ISO date time format) into Date (at UTC time zone)
    • getDateToStringMapper

      public Function<Date,String> getDateToStringMapper()
      Returns mapping function from Date (at UTC time zone) into String (in ISO date time format)
    • assertValidSingleCodeCoupon

      public void assertValidSingleCodeCoupon(AbstractCouponModel couponModel, String couponId)
      Given the couponModel and couponId string, checks for instance of SingleCode Coupon, otherwise throws exception
      Parameters:
      couponModel -
      couponId -
    • assertValidMultiCodeCoupon

      public void assertValidMultiCodeCoupon(AbstractCouponModel couponModel, String couponId)
      Given the couponModel and couponId string, checks for instance of MultiCode Coupon, otherwise throws exception
      Parameters:
      couponModel -
      couponId -
    • getValidMultiCodeCoupon

      public MultiCodeCouponModel getValidMultiCodeCoupon(String couponId)
      Given the couponId string, checks for instance of MultiCode Coupon, otherwise throws exception
      Parameters:
      couponId - a string to be used to find MultiCode coupon
      Returns:
      - an instance of MultiCodeCouponModel
    • getCouponById

      public AbstractCouponModel getCouponById(String couponId)
      Given the couponId string, checks for instance of Coupon, otherwise throws exception
      Parameters:
      couponId - a string to be used to find Coupon
      Returns:
      AbstractCouponModel - an instance of AbstractCouponModel
    • getCouponDao

      protected CouponDao getCouponDao()
    • setCouponDao

      public void setCouponDao(CouponDao couponDao)