Class ItemOfferAdjustment
java.lang.Object
com.broadleafcommerce.promotion.offer.web.context.info.ItemOfferAdjustment
- All Implemented Interfaces:
Serializable
DTO containing price adjustment information for a
EnhancedLineItem caused by a
CandidateItemOffer targeting it. Tracks whether the
EnhancedLineItem.getStandardPrice() or EnhancedLineItem.getSalePrice() should be
discounted.- 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 adjustment.booleanvoidfinalizeAdjustment(boolean useSalePrice) SetsadjustmentValueandappliedToSalePrice.javax.money.MonetaryAmountThe final amount by which to adjust theorder item'sprice.javax.money.MonetaryAmountMax value per order filtering occurs as an item offer is being processed.TheCandidateItemOfferDTO related tooffer.intThe total quantity of the current line item this offer was applied to.Set to "Y" if the adjustment should ignore a merge due to being part of a max savings calculation.intMaintains the number of periods to discount by theadjustmentValueif this is aDefaultAdjustmentType.RECURRING_DISCOUNTadjustment.intMaintains the number of periods to discount by thestandardAdjustmentValueif this is aDefaultAdjustmentType.RECURRING_DISCOUNTadjustment.intMaintains the number of periods to discount by thesaleAdjustmentValueif this is aDefaultAdjustmentType.RECURRING_DISCOUNTadjustment.getOffer()intThe total number of times that the offer this adjustment was created from is applied.List<com.broadleafcommerce.promotion.offer.client.web.context.info.OfferItemDetail>A list ofOfferItemDetailsrepresenting the qualifier items where this adjustment was from.intintThe quantity per offer usage of the item where this adjustment is applied to (target item).javax.money.MonetaryAmountThe amount by which to adjust theEnhancedLineItem.getSalePrice().javax.money.MonetaryAmountThe amount by which to adjust theEnhancedLineItem.getStandardPrice().getType()inthashCode()booleanWhether theadjustmentValuewas applied toEnhancedLineItem.getStandardPrice()orEnhancedLineItem.getSalePrice().booleanbooleanDeprecated, for removal: This API element is subject to removal in a future version.booleanvoidsetAdjustmentValue(javax.money.MonetaryAmount adjustmentValue) The final amount by which to adjust theorder item'sprice.voidsetAppliedToSalePrice(boolean appliedToSalePrice) Whether theadjustmentValuewas applied toEnhancedLineItem.getStandardPrice()orEnhancedLineItem.getSalePrice().voidsetCandidateItemOffer(CandidateItemOffer candidateItemOffer) TheCandidateItemOfferDTO related tooffer.voidsetFutureCredit(boolean isFutureCredit) Deprecated, for removal: This API element is subject to removal in a future version.UsesetType(String)voidsetItemAdjustmentQuantity(int itemAdjustmentQuantity) The total quantity of the current line item this offer was applied to.voidsetMaxSavingIndicator(String maxSavingIndicator) Set to "Y" if the adjustment should ignore a merge due to being part of a max savings calculation.voidsetNumberOfPeriodsToDiscount(int numberOfPeriodsToDiscount) Maintains the number of periods to discount by theadjustmentValueif this is aDefaultAdjustmentType.RECURRING_DISCOUNTadjustment.voidsetNumberOfPeriodsToDiscountForSale(int numberOfPeriodsToDiscountForSale) Maintains the number of periods to discount by thestandardAdjustmentValueif this is aDefaultAdjustmentType.RECURRING_DISCOUNTadjustment.voidsetNumberOfPeriodsToDiscountForStandard(int numberOfPeriodsToDiscountForStandard) Maintains the number of periods to discount by thesaleAdjustmentValueif this is aDefaultAdjustmentType.RECURRING_DISCOUNTadjustment.voidTheOffertargeting someEnhancedLineItem.voidsetOfferUses(int offerUses) The total number of times that the offer this adjustment was created from is applied.voidsetParentDetail(LineItemOfferDetail parentDetail) voidsetQualifierDetails(List<com.broadleafcommerce.promotion.offer.client.web.context.info.OfferItemDetail> qualifierDetails) A list ofOfferItemDetailsrepresenting the qualifier items where this adjustment was from.voidsetQuantityPerUsage(int quantityPerUsage) The quantity per offer usage of the item where this adjustment is applied to (target item).voidsetSaleAdjustmentValue(javax.money.MonetaryAmount saleAdjustmentValue) The amount by which to adjust theEnhancedLineItem.getSalePrice().voidsetStandardAdjustmentValue(javax.money.MonetaryAmount standardAdjustmentValue) The amount by which to adjust theEnhancedLineItem.getStandardPrice().voidtoString()
-
Constructor Details
-
ItemOfferAdjustment
public ItemOfferAdjustment()
-
-
Method Details
-
setType
- See Also:
-
type
-
getType
- See Also:
-
type
-
setFutureCredit
@Deprecated(since="Offer Client 2.1.0", forRemoval=true) public void setFutureCredit(boolean isFutureCredit) Deprecated, for removal: This API element is subject to removal in a future version.UsesetType(String)- See Also:
-
isFutureCredit
Deprecated, for removal: This API element is subject to removal in a future version.UsegetType()- See Also:
-
getQuantity
public int getQuantity() -
getLineItem
-
isCombinable
public boolean isCombinable()- Returns:
- whether the
offerisCombinabilityType.ANY
-
isTotalitarian
public boolean isTotalitarian()- Returns:
- whether the
offerisCombinabilityType.NONE
-
finalizeAdjustment
public void finalizeAdjustment(boolean useSalePrice) SetsadjustmentValueandappliedToSalePrice.- Parameters:
useSalePrice- whether to use thesaleAdjustmentValueor thestandardAdjustmentValue.
-
copy
@NonNull public ItemOfferAdjustment copy(@NonNull com.broadleafcommerce.common.extension.TypeFactory offerFactory) Creates a copy of this adjustment.- Parameters:
offerFactory- theTypeFactoryused to create a new adjustment instance- Returns:
- the new adjustment instance
-
getOffer
- Returns:
- The
Offertargeting someEnhancedLineItem.
-
getAdjustmentValueForMaxSavings
public javax.money.MonetaryAmount getAdjustmentValueForMaxSavings()Max value per order filtering occurs as an item offer is being processed. The check is made based on the probable end adjustment. -
getCandidateItemOffer
TheCandidateItemOfferDTO related tooffer.- Returns:
- The
CandidateItemOfferDTO related tooffer.
-
getSaleAdjustmentValue
public javax.money.MonetaryAmount getSaleAdjustmentValue()The amount by which to adjust theEnhancedLineItem.getSalePrice().- Returns:
- The amount by which to adjust the
EnhancedLineItem.getSalePrice().
-
getStandardAdjustmentValue
public javax.money.MonetaryAmount getStandardAdjustmentValue()The amount by which to adjust theEnhancedLineItem.getStandardPrice().- Returns:
- The amount by which to adjust the
EnhancedLineItem.getStandardPrice().
-
getAdjustmentValue
public javax.money.MonetaryAmount getAdjustmentValue()The final amount by which to adjust theorder item'sprice.- Returns:
- The final amount by which to adjust the
order item'sprice.
-
isAppliedToSalePrice
public boolean isAppliedToSalePrice()Whether theadjustmentValuewas applied toEnhancedLineItem.getStandardPrice()orEnhancedLineItem.getSalePrice().- Returns:
- Whether the
adjustmentValuewas applied toEnhancedLineItem.getStandardPrice()orEnhancedLineItem.getSalePrice().
-
getParentDetail
-
getQualifierDetails
public List<com.broadleafcommerce.promotion.offer.client.web.context.info.OfferItemDetail> getQualifierDetails()A list ofOfferItemDetailsrepresenting the qualifier items where this adjustment was from. -
getQuantityPerUsage
public int getQuantityPerUsage()The quantity per offer usage of the item where this adjustment is applied to (target item). -
getItemAdjustmentQuantity
public int getItemAdjustmentQuantity()The total quantity of the current line item this offer was applied to. -
getOfferUses
public int getOfferUses()The total number of times that the offer this adjustment was created from is applied. -
getMaxSavingIndicator
Set to "Y" if the adjustment should ignore a merge due to being part of a max savings calculation. -
getNumberOfPeriodsToDiscountForSale
public int getNumberOfPeriodsToDiscountForSale()Maintains the number of periods to discount by thestandardAdjustmentValueif this is aDefaultAdjustmentType.RECURRING_DISCOUNTadjustment.- Since:
- Offer Service 3.1.0, Release Train 2.2.0
-
getNumberOfPeriodsToDiscountForStandard
public int getNumberOfPeriodsToDiscountForStandard()Maintains the number of periods to discount by thesaleAdjustmentValueif this is aDefaultAdjustmentType.RECURRING_DISCOUNTadjustment.- Since:
- Offer Service 3.1.0, Release Train 2.2.0
-
getNumberOfPeriodsToDiscount
public int getNumberOfPeriodsToDiscount()Maintains the number of periods to discount by theadjustmentValueif this is aDefaultAdjustmentType.RECURRING_DISCOUNTadjustment.- Since:
- Offer Service 3.1.0, Release Train 2.2.0
-
setOffer
TheOffertargeting someEnhancedLineItem.- Parameters:
offer- TheOffertargeting someEnhancedLineItem.
-
setCandidateItemOffer
TheCandidateItemOfferDTO related tooffer.- Parameters:
candidateItemOffer- TheCandidateItemOfferDTO related tooffer.
-
setSaleAdjustmentValue
public void setSaleAdjustmentValue(javax.money.MonetaryAmount saleAdjustmentValue) The amount by which to adjust theEnhancedLineItem.getSalePrice().- Parameters:
saleAdjustmentValue- The amount by which to adjust theEnhancedLineItem.getSalePrice().
-
setStandardAdjustmentValue
public void setStandardAdjustmentValue(javax.money.MonetaryAmount standardAdjustmentValue) The amount by which to adjust theEnhancedLineItem.getStandardPrice().- Parameters:
amount- The amount by which to adjust theEnhancedLineItem.getStandardPrice().
-
setAdjustmentValue
public void setAdjustmentValue(javax.money.MonetaryAmount adjustmentValue) The final amount by which to adjust theorder item'sprice.- Parameters:
adjustmentValue- The final amount by which to adjust theorder item'sprice.
-
setAppliedToSalePrice
public void setAppliedToSalePrice(boolean appliedToSalePrice) Whether theadjustmentValuewas applied toEnhancedLineItem.getStandardPrice()orEnhancedLineItem.getSalePrice().- Parameters:
appliedToSalePrice- Whether theadjustmentValuewas applied toEnhancedLineItem.getStandardPrice()orEnhancedLineItem.getSalePrice().
-
setParentDetail
-
setQualifierDetails
public void setQualifierDetails(List<com.broadleafcommerce.promotion.offer.client.web.context.info.OfferItemDetail> qualifierDetails) A list ofOfferItemDetailsrepresenting the qualifier items where this adjustment was from. -
setQuantityPerUsage
public void setQuantityPerUsage(int quantityPerUsage) The quantity per offer usage of the item where this adjustment is applied to (target item). -
setItemAdjustmentQuantity
public void setItemAdjustmentQuantity(int itemAdjustmentQuantity) The total quantity of the current line item this offer was applied to. -
setOfferUses
public void setOfferUses(int offerUses) The total number of times that the offer this adjustment was created from is applied. -
setMaxSavingIndicator
Set to "Y" if the adjustment should ignore a merge due to being part of a max savings calculation. -
setNumberOfPeriodsToDiscountForSale
public void setNumberOfPeriodsToDiscountForSale(int numberOfPeriodsToDiscountForSale) Maintains the number of periods to discount by thestandardAdjustmentValueif this is aDefaultAdjustmentType.RECURRING_DISCOUNTadjustment.- Since:
- Offer Service 3.1.0, Release Train 2.2.0
-
setNumberOfPeriodsToDiscountForStandard
public void setNumberOfPeriodsToDiscountForStandard(int numberOfPeriodsToDiscountForStandard) Maintains the number of periods to discount by thesaleAdjustmentValueif this is aDefaultAdjustmentType.RECURRING_DISCOUNTadjustment.- Since:
- Offer Service 3.1.0, Release Train 2.2.0
-
setNumberOfPeriodsToDiscount
public void setNumberOfPeriodsToDiscount(int numberOfPeriodsToDiscount) Maintains the number of periods to discount by theadjustmentValueif this is aDefaultAdjustmentType.RECURRING_DISCOUNTadjustment.- Since:
- Offer Service 3.1.0, Release Train 2.2.0
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
getType()