|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.broadleafcommerce.core.offer.service.discount.domain.AbstractPromotionRounding
org.broadleafcommerce.core.offer.service.discount.domain.PromotableCandidateItemOfferImpl
public class PromotableCandidateItemOfferImpl
| Field Summary | |
|---|---|
protected HashMap<OfferItemCriteria,List<PromotableOrderItem>> |
candidateQualifiersMap
|
protected List<PromotableOrderItem> |
candidateTargets
|
protected Offer |
offer
|
protected Money |
potentialSavings
|
protected PromotableOrder |
promotableOrder
|
protected int |
uses
|
| Fields inherited from class org.broadleafcommerce.core.offer.service.discount.domain.AbstractPromotionRounding |
|---|
roundingMode, roundingScale, roundOfferValues |
| Constructor Summary | |
|---|---|
PromotableCandidateItemOfferImpl(PromotableOrder promotableOrder,
Offer offer)
|
|
| Method Summary | |
|---|---|
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 |
resetUses()
Resets the uses for this candidate offer item. |
void |
setCandidateQualifiersMap(HashMap<OfferItemCriteria,List<PromotableOrderItem>> candidateItemsMap)
|
void |
setCandidateTargets(List<PromotableOrderItem> candidateTargets)
|
void |
setPotentialSavings(Money potentialSavings)
|
| Methods inherited from class org.broadleafcommerce.core.offer.service.discount.domain.AbstractPromotionRounding |
|---|
getRoundingMode, getRoundingScale, isRoundOfferValues, setRoundingMode, setRoundingScale |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Offer offer
protected PromotableOrder promotableOrder
protected Money potentialSavings
protected int uses
protected HashMap<OfferItemCriteria,List<PromotableOrderItem>> candidateQualifiersMap
protected List<PromotableOrderItem> candidateTargets
| Constructor Detail |
|---|
public PromotableCandidateItemOfferImpl(PromotableOrder promotableOrder,
Offer offer)
| Method Detail |
|---|
public Money calculatePotentialSavings()
public BroadleafCurrency getCurrency()
getCurrency in interface OfferHolder
public Money calculateSavingsForOrderItem(PromotableOrderItem orderItem,
int qtyToReceiveSavings)
PromotableCandidateItemOffer
calculateSavingsForOrderItem 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 PromotableCandidateItemOffer
public int calculateMaxUsesForItemCriteria(OfferItemCriteria itemCriteria,
Offer promotion)
PromotableCandidateItemOffer
calculateMaxUsesForItemCriteria 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 void resetUses()
PromotableCandidateItemOffer
resetUses in interface PromotableCandidateItemOfferItemOfferProcessor#applyAndCompareOrderAndItemOffers(PromotableOrder, List, List)}public boolean isLegacyOffer()
isLegacyOffer in interface PromotableCandidateItemOffer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||