org.broadleafcommerce.core.offer.service.discount.domain
Class PromotableOrderAdjustmentImpl

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

public class PromotableOrderAdjustmentImpl
extends Object
implements PromotableOrderAdjustment

See Also:
Serialized Form

Field Summary
protected  Money adjustmentValue
           
protected  Offer offer
           
protected  PromotableCandidateOrderOffer promotableCandidateOrderOffer
           
protected  PromotableOrder promotableOrder
           
protected  RoundingMode roundingMode
           
protected  int roundingScale
           
protected  boolean roundOfferValues
           
 
Constructor Summary
PromotableOrderAdjustmentImpl(PromotableCandidateOrderOffer promotableCandidateOrderOffer, PromotableOrder promotableOrder)
           
PromotableOrderAdjustmentImpl(PromotableCandidateOrderOffer promotableCandidateOrderOffer, PromotableOrder promotableOrder, Money adjustmentValue)
           
 
Method Summary
protected  void computeAdjustmentValue()
           
 Money getAdjustmentValue()
          Returns the value of this adjustment
 Offer getOffer()
          Returns the associated promotableCandidateOrderOffer
 PromotableOrder getPromotableOrder()
          Returns the associated promotableOrder
 RoundingMode getRoundingMode()
           
 int getRoundingScale()
           
 boolean isCombinable()
          Returns true if this adjustment represents a combinable offer.
 boolean isRoundOfferValues()
          It is sometimes problematic to offer percentage-off offers with regards to rounding.
 boolean isTotalitarian()
          Returns true if this adjustment represents a totalitarian offer.
 void setRoundingMode(RoundingMode roundingMode)
           
 void setRoundingScale(int roundingScale)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

promotableCandidateOrderOffer

protected PromotableCandidateOrderOffer promotableCandidateOrderOffer

promotableOrder

protected PromotableOrder promotableOrder

adjustmentValue

protected Money adjustmentValue

offer

protected Offer offer

roundOfferValues

protected boolean roundOfferValues

roundingScale

protected int roundingScale

roundingMode

protected RoundingMode roundingMode
Constructor Detail

PromotableOrderAdjustmentImpl

public PromotableOrderAdjustmentImpl(PromotableCandidateOrderOffer promotableCandidateOrderOffer,
                                     PromotableOrder promotableOrder)

PromotableOrderAdjustmentImpl

public PromotableOrderAdjustmentImpl(PromotableCandidateOrderOffer promotableCandidateOrderOffer,
                                     PromotableOrder promotableOrder,
                                     Money adjustmentValue)
Method Detail

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 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.


setRoundingScale

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

getRoundingScale

public int getRoundingScale()

setRoundingMode

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

getRoundingMode

public RoundingMode getRoundingMode()

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


Copyright © 2013. All Rights Reserved.