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:
PromotableOrderAdjustment

public class PromotableOrderAdjustmentImpl
extends Object
implements PromotableOrderAdjustment


Field Summary
protected  OrderAdjustment delegate
           
protected  PromotableOrder order
           
protected  RoundingMode roundingMode
           
protected  int roundingScale
           
protected  boolean roundOfferValues
           
 
Constructor Summary
PromotableOrderAdjustmentImpl(OrderAdjustment orderAdjustment, PromotableOrder order)
           
 
Method Summary
 void computeAdjustmentValue()
           
 OrderAdjustment getDelegate()
           
 Money getValue()
           
 boolean isRoundOfferValues()
          It is sometimes problematic to offer percentage-off offers with regards to rounding.
 void reset()
           
 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

delegate

protected OrderAdjustment delegate

order

protected PromotableOrder order

roundOfferValues

protected boolean roundOfferValues

roundingScale

protected int roundingScale

roundingMode

protected RoundingMode roundingMode
Constructor Detail

PromotableOrderAdjustmentImpl

public PromotableOrderAdjustmentImpl(OrderAdjustment orderAdjustment,
                                     PromotableOrder order)
Method Detail

reset

public void reset()
Specified by:
reset in interface PromotableOrderAdjustment

getDelegate

public OrderAdjustment getDelegate()
Specified by:
getDelegate in interface PromotableOrderAdjustment

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()

setRoundingMode

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

computeAdjustmentValue

public void computeAdjustmentValue()
Specified by:
computeAdjustmentValue in interface PromotableOrderAdjustment

getValue

public Money getValue()
Specified by:
getValue in interface PromotableOrderAdjustment


Copyright © 2012. All Rights Reserved.