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
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
copy
(com.broadleafcommerce.common.extension.TypeFactory offerFactory) Creates a copy of this offer discount.boolean
int
The actual item quantity of anEnhancedLineItem
matched to theoffer
.TheOffer.getItemQualifierCriteria()
that anEnhancedLineItem
matched.The line item number of theEnhancedLineItem
that this qualifier represents.getOffer()
TheOffer
using someEnhancedLineItem
as an item qualifier.javax.money.MonetaryAmount
getPrice()
Tracks the discount amount of the relateditem qualifier
.int
The potential item quantity of anEnhancedLineItem
that matched theoffer
.A map of usageIds to quantity of theEnhancedLineItem
for the usages of this qualifier.int
hashCode()
int
incrementQuantity
(int incrementQuantity) Increments thequantity
by the given amount.void
setFinalizedQuantity
(int finalizedQuantity) The actual item quantity of anEnhancedLineItem
matched to theoffer
.void
setItemQualifierCriteria
(ItemCriteriaRule itemQualifierCriteria) TheOffer.getItemQualifierCriteria()
that anEnhancedLineItem
matched.void
setLineNumber
(String lineNumber) The line item number of theEnhancedLineItem
that this qualifier represents.void
TheOffer
using someEnhancedLineItem
as an item qualifier.void
setPrice
(javax.money.MonetaryAmount price) Tracks the discount amount of the relateditem qualifier
.void
setQuantity
(int quantity) The potential item quantity of anEnhancedLineItem
that matched theoffer
.void
setUsageDetails
(Map<String, Integer> usageDetails) A map of usageIds to quantity of theEnhancedLineItem
for 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 thequantity
by 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
- theTypeFactory
required to create a new instance- Returns:
- the copied instance
-
getOffer
TheOffer
using someEnhancedLineItem
as an item qualifier.- Returns:
- The
Offer
using someEnhancedLineItem
as an item qualifier.
-
getItemQualifierCriteria
TheOffer.getItemQualifierCriteria()
that anEnhancedLineItem
matched.- Returns:
- The
Offer.getItemQualifierCriteria()
that anEnhancedLineItem
matched.
-
getLineNumber
The line item number of theEnhancedLineItem
that this qualifier represents.- Returns:
- The line item number of the
EnhancedLineItem
that this qualifier represents.
-
getUsageDetails
A map of usageIds to quantity of theEnhancedLineItem
for the usages of this qualifier.- Returns:
- A map of usageIds to quantity of the
EnhancedLineItem
for the usages of this qualifier.
-
getQuantity
public int getQuantity()The potential item quantity of anEnhancedLineItem
that matched theoffer
.- Returns:
- The potential item quantity of an
EnhancedLineItem
that matched theoffer
.
-
getFinalizedQuantity
public int getFinalizedQuantity()The actual item quantity of anEnhancedLineItem
matched to theoffer
.- Returns:
- The actual item quantity of an
EnhancedLineItem
matched 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
TheOffer
using someEnhancedLineItem
as an item qualifier.- Parameters:
offer
- TheOffer
using someEnhancedLineItem
as an item qualifier.
-
setItemQualifierCriteria
TheOffer.getItemQualifierCriteria()
that anEnhancedLineItem
matched.- Parameters:
itemQualifierCriteria
- TheOffer.getItemQualifierCriteria()
that anEnhancedLineItem
matched.
-
setLineNumber
The line item number of theEnhancedLineItem
that this qualifier represents.- Parameters:
quantity
- The line item number of theEnhancedLineItem
that this qualifier represents.
-
setUsageDetails
A map of usageIds to quantity of theEnhancedLineItem
for the usages of this qualifier.- Parameters:
quantity
- A map of usageIds to quantity of theEnhancedLineItem
for the usages of this qualifier.
-
setQuantity
public void setQuantity(int quantity) The potential item quantity of anEnhancedLineItem
that matched theoffer
.- Parameters:
quantity
- The potential item quantity of anEnhancedLineItem
that matched theoffer
.
-
setFinalizedQuantity
public void setFinalizedQuantity(int finalizedQuantity) The actual item quantity of anEnhancedLineItem
matched to theoffer
.- Parameters:
quantity
- The actual item quantity of anEnhancedLineItem
matched 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
-