Class EnhancedProratedOfferAdjustment

java.lang.Object
com.broadleafcommerce.promotion.offer.web.context.info.EnhancedProratedOfferAdjustment
All Implemented Interfaces:
com.broadleafcommerce.promotion.offer.client.web.context.info.ProratedOfferAdjustment, Serializable

public class EnhancedProratedOfferAdjustment extends Object implements com.broadleafcommerce.promotion.offer.client.web.context.info.ProratedOfferAdjustment, Serializable
Author:
Sunny Yu
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
     
    boolean
     
    javax.money.MonetaryAmount
    The amount of the prorated adjustment for the item.
    The code used (if any) that triggered the application of the offer for this adjustment.
    List<com.broadleafcommerce.promotion.offer.client.web.context.info.ItemProrationDetail>
    The details about how this prorated adjustment on a per-quantity basis.
    com.broadleafcommerce.promotion.offer.client.web.context.info.LineItemRef
    The LineItemRef of the EnhancedLineItem that gets this adjustment.
    com.broadleafcommerce.promotion.offer.client.web.context.info.OfferRef
    The OfferRef for the offer where this prorated adjustment is from.
    int
    The total quantity of merchandising items from the EnhancedLineItem to which this adjustment applies.
    int
     
    void
    setAmount(javax.money.MonetaryAmount amount)
    The amount of the prorated adjustment for the item.
    void
    setCodeUsed(String codeUsed)
    The code used (if any) that triggered the application of the offer for this adjustment.
    void
    setItemProrationDetails(List<com.broadleafcommerce.promotion.offer.client.web.context.info.ItemProrationDetail> itemProrationDetails)
    The details about how this prorated adjustment on a per-quantity basis.
    void
    setLineItem(com.broadleafcommerce.promotion.offer.client.web.context.info.LineItemRef lineItem)
    The LineItemRef of the EnhancedLineItem that gets this adjustment.
    void
    setOffer(com.broadleafcommerce.promotion.offer.client.web.context.info.OfferRef offer)
    The OfferRef for the offer where this prorated adjustment is from.
    void
    setQuantity(int quantity)
    The total quantity of merchandising items from the EnhancedLineItem to which this adjustment applies.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • EnhancedProratedOfferAdjustment

      public EnhancedProratedOfferAdjustment()
  • Method Details

    • getLineItem

      public com.broadleafcommerce.promotion.offer.client.web.context.info.LineItemRef getLineItem()
      The LineItemRef of the EnhancedLineItem that gets this adjustment.
      Specified by:
      getLineItem in interface com.broadleafcommerce.promotion.offer.client.web.context.info.ProratedOfferAdjustment
      Returns:
      The LineItemRef of the EnhancedLineItem that gets this adjustment.
    • getOffer

      public com.broadleafcommerce.promotion.offer.client.web.context.info.OfferRef getOffer()
      The OfferRef for the offer where this prorated adjustment is from.
      Specified by:
      getOffer in interface com.broadleafcommerce.promotion.offer.client.web.context.info.ProratedOfferAdjustment
      Returns:
      The OfferRef for the offer where this prorated adjustment is from.
    • getAmount

      public javax.money.MonetaryAmount getAmount()
      The amount of the prorated adjustment for the item.

      This should equal to the sum of ItemProrationDetail.getUnitAmount() * ItemProrationDetail.getQuantity() in getItemProrationDetails().

      Specified by:
      getAmount in interface com.broadleafcommerce.promotion.offer.client.web.context.info.ProratedOfferAdjustment
      Returns:
      The amount of the prorated adjustment for the item.
    • getQuantity

      public int getQuantity()
      The total quantity of merchandising items from the EnhancedLineItem to which this adjustment applies.

      This should equal to the sum of ItemProrationDetail.getQuantity() in getItemProrationDetails().

      Specified by:
      getQuantity in interface com.broadleafcommerce.promotion.offer.client.web.context.info.ProratedOfferAdjustment
      Returns:
      The quantity of merchandising items from the EnhancedLineItem to which this adjustment applies.
    • getCodeUsed

      public String getCodeUsed()
      The code used (if any) that triggered the application of the offer for this adjustment.
      Specified by:
      getCodeUsed in interface com.broadleafcommerce.promotion.offer.client.web.context.info.ProratedOfferAdjustment
      Returns:
      The code used (if any) that triggered the application of the offer for this adjustment.
    • getItemProrationDetails

      public List<com.broadleafcommerce.promotion.offer.client.web.context.info.ItemProrationDetail> getItemProrationDetails()
      The details about how this prorated adjustment on a per-quantity basis.

      For example, if the prorated adjustment for this item is $5 and this item has a quantity of 3, there should be one detail with quantity of 2 and amount of $1.67, and one detail with quantity of 1 and amount of $1.66, totaling to $5

      Specified by:
      getItemProrationDetails in interface com.broadleafcommerce.promotion.offer.client.web.context.info.ProratedOfferAdjustment
      Returns:
      The details about how this prorated adjustment on a per-quantity basis.
    • setLineItem

      public void setLineItem(com.broadleafcommerce.promotion.offer.client.web.context.info.LineItemRef lineItem)
      The LineItemRef of the EnhancedLineItem that gets this adjustment.
      Specified by:
      setLineItem in interface com.broadleafcommerce.promotion.offer.client.web.context.info.ProratedOfferAdjustment
      Parameters:
      itemLineNumber - The LineItemRef of the EnhancedLineItem that gets this adjustment.
    • setOffer

      public void setOffer(com.broadleafcommerce.promotion.offer.client.web.context.info.OfferRef offer)
      The OfferRef for the offer where this prorated adjustment is from.
      Specified by:
      setOffer in interface com.broadleafcommerce.promotion.offer.client.web.context.info.ProratedOfferAdjustment
      Parameters:
      offerRef - The OfferRef for the offer where this prorated adjustment is from.
    • setAmount

      public void setAmount(javax.money.MonetaryAmount amount)
      The amount of the prorated adjustment for the item.

      This should equal to the sum of ItemProrationDetail.getUnitAmount() * ItemProrationDetail.getQuantity() in getItemProrationDetails().

      Specified by:
      setAmount in interface com.broadleafcommerce.promotion.offer.client.web.context.info.ProratedOfferAdjustment
      Parameters:
      amount - The amount of the prorated adjustment for the item.
    • setQuantity

      public void setQuantity(int quantity)
      The total quantity of merchandising items from the EnhancedLineItem to which this adjustment applies.

      This should equal to the sum of ItemProrationDetail.getQuantity() in getItemProrationDetails().

      Specified by:
      setQuantity in interface com.broadleafcommerce.promotion.offer.client.web.context.info.ProratedOfferAdjustment
      Parameters:
      quantity - The quantity of merchandising items from the EnhancedLineItem to which this adjustment applies.
    • setCodeUsed

      public void setCodeUsed(String codeUsed)
      The code used (if any) that triggered the application of the offer for this adjustment.
      Specified by:
      setCodeUsed in interface com.broadleafcommerce.promotion.offer.client.web.context.info.ProratedOfferAdjustment
      Parameters:
      codeUsed - The code used (if any) that triggered the application of the offer for this adjustment.
    • setItemProrationDetails

      public void setItemProrationDetails(List<com.broadleafcommerce.promotion.offer.client.web.context.info.ItemProrationDetail> itemProrationDetails)
      The details about how this prorated adjustment on a per-quantity basis.

      For example, if the prorated adjustment for this item is $5 and this item has a quantity of 3, there should be one detail with quantity of 2 and amount of $1.67, and one detail with quantity of 1 and amount of $1.66, totaling to $5

      Specified by:
      setItemProrationDetails in interface com.broadleafcommerce.promotion.offer.client.web.context.info.ProratedOfferAdjustment
      Parameters:
      itemProrationDetails - The details about how this prorated adjustment on a per-quantity basis.
    • 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