Class OfferQualifier
java.lang.Object
com.broadleafcommerce.promotion.offer.web.context.info.OfferQualifier
- All Implemented Interfaces:
Serializable
DTO containing information about the
order items used by an
Offer as item qualifiers. This includes the quantity used and and the
Offer.getItemQualifierCriteria() an order item matched.- Author:
- Nathan Moore (nathanmoore).
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancopy(com.broadleafcommerce.common.extension.TypeFactory offerFactory) Creates a copy of this offer discount.booleanintThe actual item quantity of anEnhancedLineItemmatched to theoffer.TheOffer.getItemQualifierCriteria()that anEnhancedLineItemmatched.The line item number of theEnhancedLineItemthat this qualifier represents.getOffer()TheOfferusing someEnhancedLineItemas an item qualifier.javax.money.MonetaryAmountgetPrice()Tracks the discount amount of the relateditem qualifier.intThe potential item quantity of anEnhancedLineItemthat matched theoffer.A map of usageIds to quantity of theEnhancedLineItemfor the usages of this qualifier.inthashCode()intincrementQuantity(int incrementQuantity) Increments thequantityby the given amount.voidsetFinalizedQuantity(int finalizedQuantity) The actual item quantity of anEnhancedLineItemmatched to theoffer.voidsetItemQualifierCriteria(ItemCriteriaRule itemQualifierCriteria) TheOffer.getItemQualifierCriteria()that anEnhancedLineItemmatched.voidsetLineNumber(String lineNumber) The line item number of theEnhancedLineItemthat this qualifier represents.voidTheOfferusing someEnhancedLineItemas an item qualifier.voidsetPrice(javax.money.MonetaryAmount price) Tracks the discount amount of the relateditem qualifier.voidsetQuantity(int quantity) The potential item quantity of anEnhancedLineItemthat matched theoffer.voidsetUsageDetails(Map<String, Integer> usageDetails) A map of usageIds to quantity of theEnhancedLineItemfor the usages of this qualifier.split(com.broadleafcommerce.common.extension.TypeFactory offerFactory, int splitItemQty) Checks to see that the discount quantities match the target quantities.toString()
-
Constructor Details
-
OfferQualifier
public OfferQualifier()
-
-
Method Details
-
incrementQuantity
public int incrementQuantity(int incrementQuantity) Increments thequantityby the given amount.- Parameters:
incrementQuantity- amount by which to incrementquantity- Returns:
- the new quantity
-
split
@NonNull public OfferQualifier split(@NonNull com.broadleafcommerce.common.extension.TypeFactory offerFactory, int splitItemQty) Checks to see that the discount quantities match the target quantities. If not, splits this item into two.- Returns:
- the item created by splitting
-
copy
Creates a copy of this offer discount.- Parameters:
offerFactory- theTypeFactoryrequired to create a new instance- Returns:
- the copied instance
-
getOffer
TheOfferusing someEnhancedLineItemas an item qualifier.- Returns:
- The
Offerusing someEnhancedLineItemas an item qualifier.
-
getItemQualifierCriteria
TheOffer.getItemQualifierCriteria()that anEnhancedLineItemmatched.- Returns:
- The
Offer.getItemQualifierCriteria()that anEnhancedLineItemmatched.
-
getLineNumber
The line item number of theEnhancedLineItemthat this qualifier represents.- Returns:
- The line item number of the
EnhancedLineItemthat this qualifier represents.
-
getUsageDetails
A map of usageIds to quantity of theEnhancedLineItemfor the usages of this qualifier.- Returns:
- A map of usageIds to quantity of the
EnhancedLineItemfor the usages of this qualifier.
-
getQuantity
public int getQuantity()The potential item quantity of anEnhancedLineItemthat matched theoffer.- Returns:
- The potential item quantity of an
EnhancedLineItemthat matched theoffer.
-
getFinalizedQuantity
public int getFinalizedQuantity()The actual item quantity of anEnhancedLineItemmatched to theoffer.- Returns:
- The actual item quantity of an
EnhancedLineItemmatched to theoffer.
-
getPrice
public javax.money.MonetaryAmount getPrice()Tracks the discount amount of the relateditem qualifier. The discount amount will be 0 if this item was only used as a qualifier. -
setOffer
TheOfferusing someEnhancedLineItemas an item qualifier.- Parameters:
offer- TheOfferusing someEnhancedLineItemas an item qualifier.
-
setItemQualifierCriteria
TheOffer.getItemQualifierCriteria()that anEnhancedLineItemmatched.- Parameters:
itemQualifierCriteria- TheOffer.getItemQualifierCriteria()that anEnhancedLineItemmatched.
-
setLineNumber
The line item number of theEnhancedLineItemthat this qualifier represents.- Parameters:
quantity- The line item number of theEnhancedLineItemthat this qualifier represents.
-
setUsageDetails
A map of usageIds to quantity of theEnhancedLineItemfor the usages of this qualifier.- Parameters:
quantity- A map of usageIds to quantity of theEnhancedLineItemfor the usages of this qualifier.
-
setQuantity
public void setQuantity(int quantity) The potential item quantity of anEnhancedLineItemthat matched theoffer.- Parameters:
quantity- The potential item quantity of anEnhancedLineItemthat matched theoffer.
-
setFinalizedQuantity
public void setFinalizedQuantity(int finalizedQuantity) The actual item quantity of anEnhancedLineItemmatched to theoffer.- Parameters:
quantity- The actual item quantity of anEnhancedLineItemmatched to theoffer.
-
setPrice
public void setPrice(javax.money.MonetaryAmount price) Tracks the discount amount of the relateditem qualifier. The discount amount will be 0 if this item was only used as a qualifier. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-