Class AbstractFindCouponStrategy
- java.lang.Object
-
- de.hybris.platform.couponservices.strategies.impl.AbstractFindCouponStrategy
-
- All Implemented Interfaces:
FindCouponStrategy
- Direct Known Subclasses:
DefaultFindCustomerCouponStrategy,DefaultFindMultiCodeCouponStrategy,DefaultFindSingleCodeCouponStrategy
public abstract class AbstractFindCouponStrategy extends java.lang.Object implements FindCouponStrategy
Abstract base class for all out of the box FindCouponStrategy implementations
-
-
Constructor Summary
Constructors Constructor Description AbstractFindCouponStrategy()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.util.Optional<AbstractCouponModel>couponValidation(AbstractCouponModel coupon)java.util.Optional<AbstractCouponModel>findCouponForCouponCode(java.lang.String couponCode)Find the coupon for the providedcouponCodewithout any validaton.java.util.Optional<AbstractCouponModel>findValidatedCouponForCouponCode(java.lang.String couponCode)Find the coupon for the providedcouponCodewith the validation of the coupon throws CouponServiceException if the coupon Code is not active or not within the date range.protected java.util.Optional<AbstractCouponModel>getCouponByCode(java.lang.String couponCode)protected CouponDaogetCouponDao()protected abstract java.lang.StringgetCouponId(java.lang.String couponCode)returns the couponId based on the givencouponCodeprotected booleanisActive(AbstractCouponModel coupon)protected booleanisEndDateAfter(java.util.Date date, java.util.Date endDate)protected booleanisStartDateBefore(java.util.Date date, java.util.Date startDate)protected booleanisWithinDateRange(AbstractCouponModel coupon)voidsetCouponDao(CouponDao couponDao)
-
-
-
Method Detail
-
findCouponForCouponCode
public java.util.Optional<AbstractCouponModel> findCouponForCouponCode(java.lang.String couponCode)
Description copied from interface:FindCouponStrategyFind the coupon for the providedcouponCodewithout any validaton.- Specified by:
findCouponForCouponCodein interfaceFindCouponStrategy- 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:FindCouponStrategyFind the coupon for the providedcouponCodewith the validation of the coupon throws CouponServiceException if the coupon Code is not active or not within the date range.- Specified by:
findValidatedCouponForCouponCodein interfaceFindCouponStrategy- 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 givencouponCode
-
couponValidation
protected java.util.Optional<AbstractCouponModel> couponValidation(AbstractCouponModel coupon)
-
isActive
protected boolean isActive(AbstractCouponModel coupon)
-
isWithinDateRange
protected boolean isWithinDateRange(AbstractCouponModel coupon)
-
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)
-
-