org.broadleafcommerce.core.offer.domain
Class OrderItemAdjustmentImpl

java.lang.Object
  extended by org.broadleafcommerce.core.offer.domain.OrderItemAdjustmentImpl
All Implemented Interfaces:
java.io.Serializable, Adjustment, OrderItemAdjustment

@Entity
public class OrderItemAdjustmentImpl
extends java.lang.Object
implements OrderItemAdjustment

See Also:
Serialized Form

Field Summary
protected  boolean appliedToSalePrice
           
protected  java.lang.Long id
           
protected  Offer offer
           
protected  OrderItem orderItem
           
protected  java.lang.String reason
           
protected  Money retailValue
           
protected  Money salesValue
           
static long serialVersionUID
           
protected  java.math.BigDecimal value
           
 
Constructor Summary
OrderItemAdjustmentImpl()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Long getId()
           
 Offer getOffer()
           
 OrderItem getOrderItem()
           
 java.lang.String getReason()
           
 Money getRetailPriceValue()
          Value of this adjustment relative to the retail price.
 Money getSalesPriceValue()
          Value of this adjustment relative to the sale price.
 Money getValue()
           
 int hashCode()
           
 void init(OrderItem orderItem, Offer offer, java.lang.String reason)
           
 boolean isAppliedToSalePrice()
          Even for items that are on sale, it is possible that an adjustment was made to the retail price that gave the customer a better offer.
 void setAppliedToSalePrice(boolean appliedToSalePrice)
           
 void setId(java.lang.Long id)
           
 void setOffer(Offer offer)
           
 void setOrderItem(OrderItem orderItem)
           
 void setReason(java.lang.String reason)
           
 void setRetailPriceValue(Money retailPriceValue)
           
 void setSalesPriceValue(Money salesPriceValue)
           
 void setValue(Money value)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

id

protected java.lang.Long id

orderItem

protected OrderItem orderItem

offer

protected Offer offer

reason

protected java.lang.String reason

value

protected java.math.BigDecimal value

appliedToSalePrice

protected boolean appliedToSalePrice

retailValue

protected Money retailValue

salesValue

protected Money salesValue
Constructor Detail

OrderItemAdjustmentImpl

public OrderItemAdjustmentImpl()
Method Detail

init

public void init(OrderItem orderItem,
                 Offer offer,
                 java.lang.String reason)
Specified by:
init in interface OrderItemAdjustment

getId

public java.lang.Long getId()
Specified by:
getId in interface Adjustment

setId

public void setId(java.lang.Long id)
Specified by:
setId in interface Adjustment

getOrderItem

public OrderItem getOrderItem()
Specified by:
getOrderItem in interface OrderItemAdjustment

getOffer

public Offer getOffer()
Specified by:
getOffer in interface Adjustment

getReason

public java.lang.String getReason()
Specified by:
getReason in interface Adjustment

setReason

public void setReason(java.lang.String reason)
Specified by:
setReason in interface Adjustment

setOrderItem

public void setOrderItem(OrderItem orderItem)
Specified by:
setOrderItem in interface OrderItemAdjustment

setOffer

public void setOffer(Offer offer)

getValue

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

setValue

public void setValue(Money value)
Specified by:
setValue in interface Adjustment

isAppliedToSalePrice

public boolean isAppliedToSalePrice()
Description copied from interface: OrderItemAdjustment
Even for items that are on sale, it is possible that an adjustment was made to the retail price that gave the customer a better offer. Since some offers can be applied to the sale price and some only to the retail price, this setting provides the required value.

Specified by:
isAppliedToSalePrice in interface OrderItemAdjustment
Returns:
true if this adjustment was applied to the sale price

setAppliedToSalePrice

public void setAppliedToSalePrice(boolean appliedToSalePrice)
Specified by:
setAppliedToSalePrice in interface OrderItemAdjustment

getRetailPriceValue

public Money getRetailPriceValue()
Description copied from interface: OrderItemAdjustment
Value of this adjustment relative to the retail price.

Specified by:
getRetailPriceValue in interface OrderItemAdjustment
Returns:

setRetailPriceValue

public void setRetailPriceValue(Money retailPriceValue)
Specified by:
setRetailPriceValue in interface OrderItemAdjustment

getSalesPriceValue

public Money getSalesPriceValue()
Description copied from interface: OrderItemAdjustment
Value of this adjustment relative to the sale price.

Specified by:
getSalesPriceValue in interface OrderItemAdjustment
Returns:

setSalesPriceValue

public void setSalesPriceValue(Money salesPriceValue)
Specified by:
setSalesPriceValue in interface OrderItemAdjustment

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2012. All Rights Reserved.