Class OfferQualifier
- java.lang.Object
-
- com.broadleafcommerce.promotion.offer.web.context.info.OfferQualifier
-
- All Implemented Interfaces:
Serializable
public class OfferQualifier extends Object implements Serializable
DTO containing information about theorder itemsused by anOfferas item qualifiers. This includes the quantity used and and theOffer.getItemQualifierCriteria()an order item matched.- Author:
- Nathan Moore (nathanmoore).
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OfferQualifier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)protected OfferQualifiercopy(com.broadleafcommerce.common.extension.TypeFactory offerFactory)Creates a copy of this offer discount.booleanequals(Object o)intgetFinalizedQuantity()The actual item quantity of anEnhancedLineItemmatched to theoffer.ItemCriteriaRulegetItemQualifierCriteria()TheOffer.getItemQualifierCriteria()that anEnhancedLineItemmatched.OffergetOffer()TheOfferusing someEnhancedLineItemas an item qualifier.javax.money.MonetaryAmountgetPrice()Tracks the discount amount of the relateditem qualifier.intgetQuantity()The potential item quantity of anEnhancedLineItemthat matched theoffer.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.voidsetOffer(Offer offer)TheOfferusing 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.OfferQualifiersplit(com.broadleafcommerce.common.extension.TypeFactory offerFactory, int splitItemQty)Checks to see that the discount quantities match the target quantities.StringtoString()
-
-
-
Method Detail
-
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
protected OfferQualifier copy(com.broadleafcommerce.common.extension.TypeFactory offerFactory)
Creates a copy of this offer discount.- Parameters:
offerFactory- theTypeFactoryrequired to create a new instance- Returns:
- the copied instance
-
getOffer
public Offer getOffer()
TheOfferusing someEnhancedLineItemas an item qualifier.- Returns:
- The
Offerusing someEnhancedLineItemas an item qualifier.
-
getItemQualifierCriteria
public ItemCriteriaRule getItemQualifierCriteria()
TheOffer.getItemQualifierCriteria()that anEnhancedLineItemmatched.- Returns:
- The
Offer.getItemQualifierCriteria()that anEnhancedLineItemmatched.
-
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
public void setOffer(Offer offer)
TheOfferusing someEnhancedLineItemas an item qualifier.- Parameters:
offer- TheOfferusing someEnhancedLineItemas an item qualifier.
-
setItemQualifierCriteria
public void setItemQualifierCriteria(ItemCriteriaRule itemQualifierCriteria)
TheOffer.getItemQualifierCriteria()that anEnhancedLineItemmatched.- Parameters:
itemQualifierCriteria- TheOffer.getItemQualifierCriteria()that anEnhancedLineItemmatched.
-
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.
-
canEqual
protected boolean canEqual(Object other)
-
-