public abstract class AbstractFindCouponStrategy extends Object implements FindCouponStrategy
| Constructor and Description |
|---|
AbstractFindCouponStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected Optional<AbstractCouponModel> |
couponValidation(AbstractCouponModel coupon) |
Optional<AbstractCouponModel> |
findCouponForCouponCode(String couponCode)
Find the coupon for the provided
couponCode without any validaton. |
Optional<AbstractCouponModel> |
findValidatedCouponForCouponCode(String couponCode)
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. |
protected Optional<AbstractCouponModel> |
getCouponByCode(String couponCode) |
protected CouponDao |
getCouponDao() |
protected abstract String |
getCouponId(String couponCode)
returns the couponId based on the given
couponCode |
protected boolean |
isActive(AbstractCouponModel coupon) |
protected boolean |
isEndDateAfter(Date date,
Date endDate) |
protected boolean |
isStartDateBefore(Date date,
Date startDate) |
protected boolean |
isWithinDateRange(AbstractCouponModel coupon) |
void |
setCouponDao(CouponDao couponDao) |
public Optional<AbstractCouponModel> findCouponForCouponCode(String couponCode)
FindCouponStrategycouponCode without any validaton.findCouponForCouponCode in interface FindCouponStrategycouponCode - the coupon code (i.e. as entered in a storefront etc)public Optional<AbstractCouponModel> findValidatedCouponForCouponCode(String couponCode)
FindCouponStrategycouponCode with the validation of the coupon
throws CouponServiceException if the coupon Code is not active or not within the date range.findValidatedCouponForCouponCode in interface FindCouponStrategycouponCode - the coupon code (i.e. as entered in a storefront etc)protected Optional<AbstractCouponModel> getCouponByCode(String couponCode)
protected abstract String getCouponId(String couponCode)
couponCodeprotected Optional<AbstractCouponModel> couponValidation(AbstractCouponModel coupon)
protected boolean isActive(AbstractCouponModel coupon)
protected boolean isWithinDateRange(AbstractCouponModel coupon)
protected CouponDao getCouponDao()
public void setCouponDao(CouponDao couponDao)
Copyright © 2017 SAP SE. All Rights Reserved.