public class PromotableCandidateItemOfferImpl extends AbstractPromotionRounding implements PromotableCandidateItemOffer, OfferHolder
| Modifier and Type | Field and Description |
|---|---|
protected HashMap<OfferItemCriteria,List<PromotableOrderItem>> |
candidateQualifiersMap |
protected List<PromotableOrderItem> |
candidateTargets |
protected Offer |
offer |
protected Money |
potentialSavings |
protected PromotableOrder |
promotableOrder |
protected int |
uses |
roundingMode, roundingScale, roundOfferValues| Constructor and Description |
|---|
PromotableCandidateItemOfferImpl(PromotableOrder promotableOrder,
Offer offer) |
| Modifier and Type | Method and Description |
|---|---|
void |
addUse() |
int |
calculateMaximumNumberOfUses()
Determines the maximum number of times this promotion can be used based on the
ItemCriteria and promotion's maxQty setting.
|
int |
calculateMaxUsesForItemCriteria(OfferItemCriteria itemCriteria,
Offer promotion)
Determines the max number of times this itemCriteria might apply.
|
Money |
calculatePotentialSavings()
This method determines how much the customer might save using this promotion for the
purpose of sorting promotions with the same priority.
|
Money |
calculateSavingsForOrderItem(PromotableOrderItem orderItem,
int qtyToReceiveSavings)
Public only for unit testing - not intended to be called
|
int |
calculateTargetQuantityForTieredOffer()
Returns the number of items that potentially could be targets for the offer.
|
HashMap<OfferItemCriteria,List<PromotableOrderItem>> |
getCandidateQualifiersMap() |
List<PromotableOrderItem> |
getCandidateTargets() |
BroadleafCurrency |
getCurrency() |
Offer |
getOffer() |
Money |
getPotentialSavings() |
int |
getPriority() |
int |
getUses() |
boolean |
hasQualifyingItemCriteria() |
boolean |
isLegacyOffer() |
void |
setCandidateQualifiersMap(HashMap<OfferItemCriteria,List<PromotableOrderItem>> candidateItemsMap) |
void |
setCandidateTargets(List<PromotableOrderItem> candidateTargets) |
void |
setPotentialSavings(Money potentialSavings) |
getRoundingMode, getRoundingScale, isRoundOfferValues, setRoundingMode, setRoundingScaleprotected Offer offer
protected PromotableOrder promotableOrder
protected Money potentialSavings
protected int uses
protected HashMap<OfferItemCriteria,List<PromotableOrderItem>> candidateQualifiersMap
protected List<PromotableOrderItem> candidateTargets
public PromotableCandidateItemOfferImpl(PromotableOrder promotableOrder, Offer offer)
public Money calculatePotentialSavings()
public BroadleafCurrency getCurrency()
getCurrency in interface OfferHolderpublic Money calculateSavingsForOrderItem(PromotableOrderItem orderItem, int qtyToReceiveSavings)
PromotableCandidateItemOffercalculateSavingsForOrderItem in interface PromotableCandidateItemOfferpublic int calculateTargetQuantityForTieredOffer()
calculateTargetQuantityForTieredOffer in interface PromotableCandidateItemOfferpublic Money getPotentialSavings()
getPotentialSavings in interface PromotableCandidateItemOfferpublic void setPotentialSavings(Money potentialSavings)
setPotentialSavings in interface PromotableCandidateItemOfferpublic boolean hasQualifyingItemCriteria()
hasQualifyingItemCriteria in interface PromotableCandidateItemOfferpublic int calculateMaximumNumberOfUses()
calculateMaximumNumberOfUses in interface PromotableCandidateItemOfferpublic int calculateMaxUsesForItemCriteria(OfferItemCriteria itemCriteria, Offer promotion)
PromotableCandidateItemOffercalculateMaxUsesForItemCriteria in interface PromotableCandidateItemOfferpublic HashMap<OfferItemCriteria,List<PromotableOrderItem>> getCandidateQualifiersMap()
getCandidateQualifiersMap in interface PromotableCandidateItemOfferpublic void setCandidateQualifiersMap(HashMap<OfferItemCriteria,List<PromotableOrderItem>> candidateItemsMap)
setCandidateQualifiersMap in interface PromotableCandidateItemOfferpublic List<PromotableOrderItem> getCandidateTargets()
getCandidateTargets in interface PromotableCandidateItemOfferpublic void setCandidateTargets(List<PromotableOrderItem> candidateTargets)
setCandidateTargets in interface PromotableCandidateItemOfferpublic int getPriority()
getPriority in interface PromotableCandidateItemOfferpublic Offer getOffer()
getOffer in interface OfferHoldergetOffer in interface PromotableCandidateItemOfferpublic int getUses()
getUses in interface PromotableCandidateItemOfferpublic void addUse()
addUse in interface PromotableCandidateItemOfferpublic boolean isLegacyOffer()
isLegacyOffer in interface PromotableCandidateItemOfferCopyright © 2014. All Rights Reserved.