Class AbstractFindCouponStrategy

    • Constructor Detail

      • AbstractFindCouponStrategy

        public AbstractFindCouponStrategy()
    • Method Detail

      • findCouponForCouponCode

        public java.util.Optional<AbstractCouponModel> findCouponForCouponCode​(java.lang.String couponCode)
        Description copied from interface: FindCouponStrategy
        Find the coupon for the provided couponCode without any validaton.
        Specified by:
        findCouponForCouponCode in interface FindCouponStrategy
        Parameters:
        couponCode - the coupon code (i.e. as entered in a storefront etc)
        Returns:
        AbstractCouponModel if a coupon model is found for the given coupon code.
      • findValidatedCouponForCouponCode

        public java.util.Optional<AbstractCouponModel> findValidatedCouponForCouponCode​(java.lang.String couponCode)
        Description copied from interface: FindCouponStrategy
        Find the coupon for the provided couponCode with the validation of the coupon throws CouponServiceException if the coupon Code is not active or not within the date range.
        Specified by:
        findValidatedCouponForCouponCode in interface FindCouponStrategy
        Parameters:
        couponCode - the coupon code (i.e. as entered in a storefront etc)
        Returns:
        AbstractCouponModel if a coupon model is found for the given coupon code.
      • getCouponByCode

        protected java.util.Optional<AbstractCouponModel> getCouponByCode​(java.lang.String couponCode)
      • getCouponId

        protected abstract java.lang.String getCouponId​(java.lang.String couponCode)
        returns the couponId based on the given couponCode
      • isStartDateBefore

        protected boolean isStartDateBefore​(java.util.Date date,
                                            java.util.Date startDate)
      • isEndDateAfter

        protected boolean isEndDateAfter​(java.util.Date date,
                                         java.util.Date endDate)
      • getCouponDao

        protected CouponDao getCouponDao()
      • setCouponDao

        public void setCouponDao​(CouponDao couponDao)