Class PromotableOrderAdjustmentImpl

java.lang.Object
org.broadleafcommerce.core.offer.service.discount.domain.PromotableOrderAdjustmentImpl
All Implemented Interfaces:
Serializable, PromotableOrderAdjustment

public class PromotableOrderAdjustmentImpl extends Object implements PromotableOrderAdjustment
See Also:
  • Field Details

    • promotableCandidateOrderOffer

      protected PromotableCandidateOrderOffer promotableCandidateOrderOffer
    • promotableOrder

      protected PromotableOrder promotableOrder
    • adjustmentValue

      protected org.broadleafcommerce.common.money.Money adjustmentValue
    • offer

      protected Offer offer
    • roundOfferValues

      protected boolean roundOfferValues
    • roundingScale

      protected int roundingScale
    • roundingMode

      protected RoundingMode roundingMode
    • isFutureCredit

      protected boolean isFutureCredit
  • Constructor Details

  • Method Details

    • getPromotableOrder

      public PromotableOrder getPromotableOrder()
      Description copied from interface: PromotableOrderAdjustment
      Returns the associated promotableOrder
      Specified by:
      getPromotableOrder in interface PromotableOrderAdjustment
      Returns:
    • getOffer

      public Offer getOffer()
      Description copied from interface: PromotableOrderAdjustment
      Returns the associated promotableCandidateOrderOffer
      Specified by:
      getOffer in interface PromotableOrderAdjustment
      Returns:
    • computeAdjustmentValue

      protected void computeAdjustmentValue()
    • getAdjustmentValue

      public org.broadleafcommerce.common.money.Money getAdjustmentValue()
      Description copied from interface: PromotableOrderAdjustment
      Returns the value of this adjustment
      Specified by:
      getAdjustmentValue in interface PromotableOrderAdjustment
      Returns:
    • isRoundOfferValues

      public boolean isRoundOfferValues()
      It is sometimes problematic to offer percentage-off offers with regards to rounding. For example, consider an item that costs 9.99 and has a 50% promotion. To be precise, the offer value is 4.995, but this may be a strange value to display to the user depending on the currency being used.
    • getRoundingScale

      public int getRoundingScale()
    • setRoundingScale

      public void setRoundingScale(int roundingScale)
      Parameters:
      roundingScale -
      See Also:
    • getRoundingMode

      public RoundingMode getRoundingMode()
    • setRoundingMode

      public void setRoundingMode(RoundingMode roundingMode)
      Parameters:
      roundingMode -
      See Also:
    • isCombinable

      public boolean isCombinable()
      Description copied from interface: PromotableOrderAdjustment
      Returns true if this adjustment represents a combinable offer.
      Specified by:
      isCombinable in interface PromotableOrderAdjustment
    • isTotalitarian

      public boolean isTotalitarian()
      Description copied from interface: PromotableOrderAdjustment
      Returns true if this adjustment represents a totalitarian offer.
      Specified by:
      isTotalitarian in interface PromotableOrderAdjustment
    • isFutureCredit

      public boolean isFutureCredit()
      Description copied from interface: PromotableOrderAdjustment
      Future credit means that the associated adjustment will be discounted at a later time to the customer via a credit. It is up to the implementor to decide how to achieve this. This field is used to determine if the adjustment originated from an offer marked as FUTURE_CREDIT.

      See Offer.getAdjustmentType() for more info

      Specified by:
      isFutureCredit in interface PromotableOrderAdjustment
      Returns:
    • setFutureCredit

      public void setFutureCredit(boolean futureCredit)
      Description copied from interface: PromotableOrderAdjustment
      Future credit means that the associated adjustment will be discounted at a later time to the customer via a credit. It is up to the implementor to decide how to achieve this. This field is used to determine if the adjustment originated from an offer marked as FUTURE_CREDIT.

      See Offer.getAdjustmentType() for more info

      Specified by:
      setFutureCredit in interface PromotableOrderAdjustment