Class ItemResponse<P extends ProratedItemOfferAdjustment>
java.lang.Object
com.broadleafcommerce.promotion.offer.client.web.context.discounts.ItemResponse<P>
- All Implemented Interfaces:
Serializable
public class ItemResponse<P extends ProratedItemOfferAdjustment>
extends Object
implements Serializable
A DTO structure that provides pricing information for a given
LineItem
via offer
adjustments. These adjustments are a result of running an Order
through the offer engine.- Author:
- Chad Harchar (charchar)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
javax.money.MonetaryAmount
The total final price of this item with adjustments applied.javax.money.MonetaryAmount
The original unadjusted price for each item.The original unadjusted recurring price for each item used for discount calculations.javax.money.MonetaryAmount
The future credit savings acrossitemResponseDetails
, indicated byAdjustment.isFutureCredit()
.The id for theLineItem
that thisItemResponse
represents.Detailed pricing information for this item.Prorated adjustment information for this line item.int
The total quantity across all price variations of this item.javax.money.MonetaryAmount
The final recurring (a.k.a., subscription) price of this item with adjustments applied.javax.money.MonetaryAmount
The savings to apply to recurring (a.k.a., subscription) prices.javax.money.MonetaryAmount
The total savings across allitemResponseDetails
.int
hashCode()
boolean
Whether the sale price or the standard price was adjusted.boolean
Whether the sale recurring price or the standard recurring price was adjusted.boolean
Whether a free trial offer was applied.void
setAdjustedTotal
(javax.money.MonetaryAmount adjustedTotal) The total final price of this item with adjustments applied.void
setAppliedToSalePrice
(boolean appliedToSalePrice) Whether the sale price or the standard price was adjusted.void
setAppliedToSaleRecurringPrice
(boolean appliedToSaleRecurringPrice) Whether the sale recurring price or the standard recurring price was adjusted.void
setBasePricePerItem
(javax.money.MonetaryAmount basePricePerItem) The original unadjusted price for each item.void
setBaseRecurringPricePerItem
(RecurringPriceDetail baseRecurringPricePerItem) The original unadjusted recurring price for each item used for discount calculations.void
setFreeTrialApplied
(boolean freeTrialApplied) Whether a free trial offer was applied.void
setFutureCreditSavings
(javax.money.MonetaryAmount futureCreditSavings) The future credit savings acrossitemResponseDetails
, indicated byAdjustment.isFutureCredit()
.void
The id for theLineItem
that thisItemResponse
represents.void
setItemResponseDetails
(List<ItemResponseDetail<P>> itemResponseDetails) Detailed pricing information for this item.void
setProratedAdjustments
(List<ProratedOfferAdjustment> proratedAdjustments) Prorated adjustment information for this line item.void
setQuantity
(int quantity) The total quantity across all price variations of this item.void
setRecurringAdjustedTotal
(javax.money.MonetaryAmount recurringAdjustedTotal) The final recurring (a.k.a., subscription) price of this item with adjustments applied.void
setRecurringSavings
(javax.money.MonetaryAmount recurringSavings) The savings to apply to recurring (a.k.a., subscription) prices.void
setSavings
(javax.money.MonetaryAmount savings) The total savings across allitemResponseDetails
.toString()
-
Constructor Details
-
ItemResponse
public ItemResponse()
-
-
Method Details
-
getItemId
The id for theLineItem
that thisItemResponse
represents. -
getItemResponseDetails
Detailed pricing information for this item. SeeItemResponseDetail
for more info. -
getProratedAdjustments
Prorated adjustment information for this line item. The prorated adjustments typically come from order or fulfillment group level offers. -
getBasePricePerItem
public javax.money.MonetaryAmount getBasePricePerItem()The original unadjusted price for each item. -
getBaseRecurringPricePerItem
The original unadjusted recurring price for each item used for discount calculations.- Since:
- Offer Client 2.0.2
-
isAppliedToSalePrice
public boolean isAppliedToSalePrice()Whether the sale price or the standard price was adjusted.- Since:
- Offer Client 2.0.2
-
isAppliedToSaleRecurringPrice
public boolean isAppliedToSaleRecurringPrice()Whether the sale recurring price or the standard recurring price was adjusted.- Since:
- Offer Client 2.0.2
-
getQuantity
public int getQuantity()The total quantity across all price variations of this item. -
getSavings
public javax.money.MonetaryAmount getSavings()The total savings across allitemResponseDetails
. This does not includefutureCreditSavings
. -
getAdjustedTotal
public javax.money.MonetaryAmount getAdjustedTotal()The total final price of this item with adjustments applied. -
getRecurringAdjustedTotal
public javax.money.MonetaryAmount getRecurringAdjustedTotal()The final recurring (a.k.a., subscription) price of this item with adjustments applied.- Since:
- Offer Client 2.0.2
-
getFutureCreditSavings
public javax.money.MonetaryAmount getFutureCreditSavings()The future credit savings acrossitemResponseDetails
, indicated byAdjustment.isFutureCredit()
. -
getRecurringSavings
public javax.money.MonetaryAmount getRecurringSavings()The savings to apply to recurring (a.k.a., subscription) prices.- Since:
- Offer Client 2.0.2
-
isFreeTrialApplied
public boolean isFreeTrialApplied()Whether a free trial offer was applied.- Since:
- Offer Client 2.0.2
-
setItemId
The id for theLineItem
that thisItemResponse
represents. -
setItemResponseDetails
Detailed pricing information for this item. SeeItemResponseDetail
for more info. -
setProratedAdjustments
Prorated adjustment information for this line item. The prorated adjustments typically come from order or fulfillment group level offers. -
setBasePricePerItem
public void setBasePricePerItem(javax.money.MonetaryAmount basePricePerItem) The original unadjusted price for each item. -
setBaseRecurringPricePerItem
The original unadjusted recurring price for each item used for discount calculations.- Since:
- Offer Client 2.0.2
-
setAppliedToSalePrice
public void setAppliedToSalePrice(boolean appliedToSalePrice) Whether the sale price or the standard price was adjusted.- Since:
- Offer Client 2.0.2
-
setAppliedToSaleRecurringPrice
public void setAppliedToSaleRecurringPrice(boolean appliedToSaleRecurringPrice) Whether the sale recurring price or the standard recurring price was adjusted.- Since:
- Offer Client 2.0.2
-
setQuantity
public void setQuantity(int quantity) The total quantity across all price variations of this item. -
setSavings
public void setSavings(javax.money.MonetaryAmount savings) The total savings across allitemResponseDetails
. This does not includefutureCreditSavings
. -
setAdjustedTotal
public void setAdjustedTotal(javax.money.MonetaryAmount adjustedTotal) The total final price of this item with adjustments applied. -
setRecurringAdjustedTotal
public void setRecurringAdjustedTotal(javax.money.MonetaryAmount recurringAdjustedTotal) The final recurring (a.k.a., subscription) price of this item with adjustments applied.- Since:
- Offer Client 2.0.2
-
setFutureCreditSavings
public void setFutureCreditSavings(javax.money.MonetaryAmount futureCreditSavings) The future credit savings acrossitemResponseDetails
, indicated byAdjustment.isFutureCredit()
. -
setRecurringSavings
public void setRecurringSavings(javax.money.MonetaryAmount recurringSavings) The savings to apply to recurring (a.k.a., subscription) prices.- Since:
- Offer Client 2.0.2
-
setFreeTrialApplied
public void setFreeTrialApplied(boolean freeTrialApplied) Whether a free trial offer was applied.- Since:
- Offer Client 2.0.2
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-