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

java.lang.Object
  extended by org.broadleafcommerce.core.offer.service.discount.domain.PromotableOrderItemAdjustmentImpl
All Implemented Interfaces:
PromotableOrderItemAdjustment

public class PromotableOrderItemAdjustmentImpl
extends Object
implements PromotableOrderItemAdjustment


Field Summary
protected  OrderItemAdjustment delegate
           
protected  PromotableOrderItem orderItem
           
protected  RoundingMode roundingMode
           
protected  int roundingScale
           
protected  boolean roundOfferValues
           
 
Constructor Summary
PromotableOrderItemAdjustmentImpl(OrderItemAdjustment orderItemAdjustment, PromotableOrderItem orderItem)
           
 
Method Summary
 void computeAdjustmentValues()
           
 OrderItemAdjustment getDelegate()
           
 Money getRetailPriceValue()
           
 Money getSalesPriceValue()
           
 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

orderItem

protected PromotableOrderItem orderItem

delegate

protected OrderItemAdjustment delegate

roundOfferValues

protected boolean roundOfferValues

roundingScale

protected int roundingScale

roundingMode

protected RoundingMode roundingMode
Constructor Detail

PromotableOrderItemAdjustmentImpl

public PromotableOrderItemAdjustmentImpl(OrderItemAdjustment orderItemAdjustment,
                                         PromotableOrderItem orderItem)
Method Detail

reset

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

getDelegate

public OrderItemAdjustment getDelegate()
Specified by:
getDelegate in interface PromotableOrderItemAdjustment

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

computeAdjustmentValues

public void computeAdjustmentValues()
Specified by:
computeAdjustmentValues in interface PromotableOrderItemAdjustment

getRetailPriceValue

public Money getRetailPriceValue()
Specified by:
getRetailPriceValue in interface PromotableOrderItemAdjustment

getSalesPriceValue

public Money getSalesPriceValue()
Specified by:
getSalesPriceValue in interface PromotableOrderItemAdjustment


Copyright © 2013. All Rights Reserved.