java.lang.Object
com.broadleafcommerce.promotion.offer.client.web.context.discounts.ItemResponseDetail<P>
All Implemented Interfaces:
Serializable

public class ItemResponseDetail<P extends ProratedItemOfferAdjustment> extends Object implements Serializable
Collection of pricing details for an ItemResponse.

When item discounting results in an item having multiple prices like in a buy-one-get-one free example, the item will get an additional ItemPriceDetail.

Generally, an item will have one ItemResponseDetail record for each uniquely priced version of the item.

Author:
Chad Harchar (charchar)
See Also:
  • Constructor Details

    • ItemResponseDetail

      public ItemResponseDetail()
  • Method Details

    • isFreeTrialApplied

      public boolean isFreeTrialApplied()
      Whether a DefaultAdjustmentType.FREE_TRIAL type adjustment was applied.
      Returns:
      Whether a DefaultAdjustmentType.FREE_TRIAL type adjustment was applied.
      Since:
      Offer Client 2.0.2
    • isRecurringDiscountApplied

      public boolean isRecurringDiscountApplied()
    • getQuantity

      public int getQuantity()
      The quantity of items that match this detail.
    • getItemAdjustments

      public List<ItemAdjustment> getItemAdjustments()
      Adjustment information for this line item.
    • getProratedItemAdjustments

      public List<P> getProratedItemAdjustments()
      Prorated adjustment information for this line item. See ProratedItemOfferAdjustment for more info.
    • isAppliedToSalePrice

      public boolean isAppliedToSalePrice()
      Whether the itemAdjustments are applied to the sale price of the item.
    • isAppliedToSaleRecurringPrice

      public boolean isAppliedToSaleRecurringPrice()
      Whether the itemAdjustments are applied to the sale recurring price of the item.
      Since:
      Offer Client 2.0.2
    • getSavings

      public javax.money.MonetaryAmount getSavings()
      The total savings across all itemAdjustments. This does not include futureCreditSavings.
    • getFutureCreditSavings

      public javax.money.MonetaryAmount getFutureCreditSavings()
      The future credit savings across itemAdjustments, indicated by Adjustment.isFutureCredit(). This does not include children item's future credits, use savings if desired.
    • getRecurringSavings

      public javax.money.MonetaryAmount getRecurringSavings()
      The savings to apply to recurring (a.k.a., subscription) prices.
      Since:
      Offer Client 2.0.2
    • getAdjustedTotal

      public javax.money.MonetaryAmount getAdjustedTotal()
      The 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
    • getBeginPeriod

      @Deprecated public int getBeginPeriod()
      Deprecated.
      No longer valid as more than one subscription discount may be applied. Users should look at ItemAdjustment instead.
      The beginning period for which this detail should be applied. 1 refers to the first recurring billing period, and so on. This is only used for details that describe an adjustment related to an offer that is set to apply to future periods.
    • getEndPeriod

      @Deprecated public int getEndPeriod()
      Deprecated.
      No longer valid as more than one subscription discount may be applied. Users should look at ItemAdjustment instead.
      The ending period for which this detail should be applied. 1 refers to the first recurring billing period, and so on. This is only used for details that describe an adjustment related to an offer that is set to apply to future periods.
    • setQuantity

      public void setQuantity(int quantity)
      The quantity of items that match this detail.
    • setItemAdjustments

      public void setItemAdjustments(List<ItemAdjustment> itemAdjustments)
      Adjustment information for this line item.
    • setProratedItemAdjustments

      public void setProratedItemAdjustments(List<P> proratedItemAdjustments)
      Prorated adjustment information for this line item. See ProratedItemOfferAdjustment for more info.
    • setAppliedToSalePrice

      public void setAppliedToSalePrice(boolean appliedToSalePrice)
      Whether the itemAdjustments are applied to the sale price of the item.
    • setAppliedToSaleRecurringPrice

      public void setAppliedToSaleRecurringPrice(boolean appliedToSaleRecurringPrice)
      Whether the itemAdjustments are applied to the sale recurring price of the item.
      Since:
      Offer Client 2.0.2
    • setSavings

      public void setSavings(javax.money.MonetaryAmount savings)
      The total savings across all itemAdjustments. This does not include futureCreditSavings.
    • setFutureCreditSavings

      public void setFutureCreditSavings(javax.money.MonetaryAmount futureCreditSavings)
      The future credit savings across itemAdjustments, indicated by Adjustment.isFutureCredit(). This does not include children item's future credits, use savings if desired.
    • 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
    • setAdjustedTotal

      public void setAdjustedTotal(javax.money.MonetaryAmount adjustedTotal)
      The 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
    • setBeginPeriod

      @Deprecated public void setBeginPeriod(int beginPeriod)
      Deprecated.
      No longer valid as more than one subscription discount may be applied. Users should look at ItemAdjustment instead.
      The beginning period for which this detail should be applied. 1 refers to the first recurring billing period, and so on. This is only used for details that describe an adjustment related to an offer that is set to apply to future periods.
    • setEndPeriod

      @Deprecated public void setEndPeriod(int endPeriod)
      Deprecated.
      No longer valid as more than one subscription discount may be applied. Users should look at ItemAdjustment instead.
      The ending period for which this detail should be applied. 1 refers to the first recurring billing period, and so on. This is only used for details that describe an adjustment related to an offer that is set to apply to future periods.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object