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

java.lang.Object
  extended by org.broadleafcommerce.core.offer.service.discount.domain.AbstractPromotionRounding
All Implemented Interfaces:
PromotionRounding
Direct Known Subclasses:
PromotableCandidateItemOfferImpl, PromotableFulfillmentGroupAdjustmentImpl, PromotableOrderItemPriceDetailAdjustmentImpl

public abstract class AbstractPromotionRounding
extends Object
implements PromotionRounding


Field Summary
protected  RoundingMode roundingMode
           
protected  int roundingScale
           
protected  boolean roundOfferValues
           
 
Constructor Summary
AbstractPromotionRounding()
           
 
Method Summary
 RoundingMode getRoundingMode()
          Returns the rounding mode to use for rounding operations.
 int getRoundingScale()
          Returns the scale to use when rounding.
 boolean isRoundOfferValues()
          It is sometimes problematic to offer percentage-off offers with regards to rounding.
 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

roundOfferValues

protected boolean roundOfferValues

roundingScale

protected int roundingScale

roundingMode

protected RoundingMode roundingMode
Constructor Detail

AbstractPromotionRounding

public AbstractPromotionRounding()
Method Detail

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.

Specified by:
isRoundOfferValues in interface PromotionRounding

setRoundingScale

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

setRoundingMode

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

getRoundingMode

public RoundingMode getRoundingMode()
Description copied from interface: PromotionRounding
Returns the rounding mode to use for rounding operations.

Specified by:
getRoundingMode in interface PromotionRounding
Returns:

getRoundingScale

public int getRoundingScale()
Description copied from interface: PromotionRounding
Returns the scale to use when rounding.

Specified by:
getRoundingScale in interface PromotionRounding
Returns:


Copyright © 2013. All Rights Reserved.