org.broadleafcommerce.core.order.domain
Class OrderItemImpl

java.lang.Object
  extended by org.broadleafcommerce.core.order.domain.OrderItemImpl
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, OrderItem
Direct Known Subclasses:
BundleOrderItemImpl, DiscreteOrderItemImpl

@Entity
public class OrderItemImpl
extends java.lang.Object
implements OrderItem, java.lang.Cloneable

See Also:
Serialized Form

Field Summary
protected  java.math.BigDecimal adjustmentPrice
           
protected  java.util.List<CandidateItemOffer> candidateItemOffers
           
protected  Category category
           
protected  GiftWrapOrderItem giftWrapOrderItem
           
protected  java.lang.Long id
           
protected  int markedForOffer
           
protected  java.lang.String name
           
protected  Order order
           
protected  java.util.List<OrderItemAdjustment> orderItemAdjustments
           
protected  java.lang.String orderItemType
           
protected  PersonalMessage personalMessage
           
protected  java.math.BigDecimal price
           
protected  java.util.List<PromotionDiscount> promotionDiscounts
           
protected  java.util.List<PromotionQualifier> promotionQualifiers
           
protected  int quantity
           
protected  java.math.BigDecimal retailPrice
           
protected  java.math.BigDecimal salePrice
           
 
Constructor Summary
OrderItemImpl()
           
 
Method Summary
 void addCandidateItemOffer(CandidateItemOffer candidateItemOffer)
           
 void addOrderItemAdjustment(OrderItemAdjustment orderItemAdjustment)
          Adds the adjustment to the order item's adjustment list and discounts the order item's adjustment price by the value of the adjustment.
 void addPromotionDiscount(CandidateItemOffer candidatePromotion, OfferItemCriteria itemCriteria, int quantity)
           
 void addPromotionQualifier(CandidateItemOffer candidatePromotion, OfferItemCriteria itemCriteria, int quantity)
           
 void assignFinalPrice()
           
 void checkCloneable(OrderItem orderItem)
           
 void clearAllDiscount()
           
protected  void clearAllNonFinalizedDiscounts()
           
protected  void clearAllNonFinalizedQualifiers()
           
 void clearAllNonFinalizedQuantities()
           
 void clearAllQualifiers()
           
 OrderItem clone()
           
 boolean equals(java.lang.Object obj)
           
 void finalizeQuantities()
           
 Money getAdjustmentPrice()
          Deprecated. 
 Money getAdjustmentValue()
           
 java.util.List<CandidateItemOffer> getCandidateItemOffers()
           
 Category getCategory()
           
 Money getCurrentPrice()
           
 GiftWrapOrderItem getGiftWrapOrderItem()
           
 java.lang.Long getId()
           
 boolean getIsDiscounted()
           
 boolean getIsOnSale()
           
 int getMarkedForOffer()
           
 java.lang.String getName()
           
 Order getOrder()
           
 java.util.List<OrderItemAdjustment> getOrderItemAdjustments()
          Returns a unmodifiable List of OrderItemAdjustment.
 OrderItemType getOrderItemType()
           
 PersonalMessage getPersonalMessage()
           
 Money getPrice()
           
 Money getPriceBeforeAdjustments(boolean allowSalesPrice)
           
protected  int getPromotionDiscountMismatchQuantity()
           
 java.util.List<PromotionDiscount> getPromotionDiscounts()
           
 java.util.List<PromotionQualifier> getPromotionQualifiers()
           
 int getQuantity()
           
 int getQuantityAvailableToBeUsedAsQualifier(Offer promotion)
           
 int getQuantityAvailableToBeUsedAsTarget(Offer promotion)
           
 Money getRetailPrice()
           
 Money getSalePrice()
           
 Money getTaxablePrice()
           
 int hashCode()
           
 boolean isAllQuantityMarkedForOffer()
           
 boolean isHasOrderItemAdjustments()
           
 boolean isInCategory(java.lang.String categoryName)
           
 boolean isNotCombinableOfferApplied()
           
protected  PromotionDiscount lookupOrCreatePromotionDiscount(CandidateItemOffer candidatePromotion)
           
protected  PromotionQualifier lookupOrCreatePromotionQualifier(CandidateItemOffer candidatePromotion)
           
 boolean markForOffer()
           
 int removeAllAdjustments()
          Removes all adjustment for this order item and reset the adjustment price.
 void removeAllCandidateItemOffers()
           
 void setAdjustmentPrice(Money adjustmentPrice)
          Deprecated. 
 void setCandidateItemOffers(java.util.List<CandidateItemOffer> candidateItemOffers)
           
 void setCategory(Category category)
           
 void setGiftWrapOrderItem(GiftWrapOrderItem giftWrapOrderItem)
           
 void setId(java.lang.Long id)
           
 void setName(java.lang.String name)
           
 void setOrder(Order order)
           
 void setOrderItemAdjustments(java.util.List<OrderItemAdjustment> orderItemAdjustments)
           
 void setOrderItemType(OrderItemType orderItemType)
           
 void setPersonalMessage(PersonalMessage personalMessage)
           
 void setPrice(Money finalPrice)
           
 void setPromotionDiscounts(java.util.List<PromotionDiscount> promotionDiscounts)
           
 void setPromotionQualifiers(java.util.List<PromotionQualifier> promotionQualifiers)
           
 void setQuantity(int quantity)
           
 void setRetailPrice(Money retailPrice)
           
 void setSalePrice(Money salePrice)
           
 java.util.List<OrderItem> split()
           
 boolean unmarkForOffer()
           
 boolean updatePrices()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected java.lang.Long id

category

protected Category category

order

protected Order order

retailPrice

protected java.math.BigDecimal retailPrice

salePrice

protected java.math.BigDecimal salePrice

price

protected java.math.BigDecimal price

quantity

protected int quantity

name

protected java.lang.String name

personalMessage

protected PersonalMessage personalMessage

giftWrapOrderItem

protected GiftWrapOrderItem giftWrapOrderItem

orderItemAdjustments

protected java.util.List<OrderItemAdjustment> orderItemAdjustments

candidateItemOffers

protected java.util.List<CandidateItemOffer> candidateItemOffers

markedForOffer

protected int markedForOffer

adjustmentPrice

protected java.math.BigDecimal adjustmentPrice

promotionDiscounts

protected java.util.List<PromotionDiscount> promotionDiscounts

promotionQualifiers

protected java.util.List<PromotionQualifier> promotionQualifiers

orderItemType

protected java.lang.String orderItemType
Constructor Detail

OrderItemImpl

public OrderItemImpl()
Method Detail

getRetailPrice

public Money getRetailPrice()
Specified by:
getRetailPrice in interface OrderItem

setRetailPrice

public void setRetailPrice(Money retailPrice)
Specified by:
setRetailPrice in interface OrderItem

getSalePrice

public Money getSalePrice()
Specified by:
getSalePrice in interface OrderItem

setSalePrice

public void setSalePrice(Money salePrice)
Specified by:
setSalePrice in interface OrderItem

getPrice

public Money getPrice()
Specified by:
getPrice in interface OrderItem

setPrice

public void setPrice(Money finalPrice)
Specified by:
setPrice in interface OrderItem

assignFinalPrice

public void assignFinalPrice()
Specified by:
assignFinalPrice in interface OrderItem

getTaxablePrice

public Money getTaxablePrice()
Specified by:
getTaxablePrice in interface OrderItem

getCurrentPrice

public Money getCurrentPrice()
Specified by:
getCurrentPrice in interface OrderItem

getPriceBeforeAdjustments

public Money getPriceBeforeAdjustments(boolean allowSalesPrice)
Specified by:
getPriceBeforeAdjustments in interface OrderItem

getQuantity

public int getQuantity()
Specified by:
getQuantity in interface OrderItem

setQuantity

public void setQuantity(int quantity)
Specified by:
setQuantity in interface OrderItem

getCategory

public Category getCategory()
Specified by:
getCategory in interface OrderItem

setCategory

public void setCategory(Category category)
Specified by:
setCategory in interface OrderItem

getCandidateItemOffers

public java.util.List<CandidateItemOffer> getCandidateItemOffers()
Specified by:
getCandidateItemOffers in interface OrderItem

setCandidateItemOffers

public void setCandidateItemOffers(java.util.List<CandidateItemOffer> candidateItemOffers)
Specified by:
setCandidateItemOffers in interface OrderItem

addCandidateItemOffer

public void addCandidateItemOffer(CandidateItemOffer candidateItemOffer)
Specified by:
addCandidateItemOffer in interface OrderItem

removeAllCandidateItemOffers

public void removeAllCandidateItemOffers()
Specified by:
removeAllCandidateItemOffers in interface OrderItem

markForOffer

public boolean markForOffer()
Specified by:
markForOffer in interface OrderItem

getMarkedForOffer

public int getMarkedForOffer()
Specified by:
getMarkedForOffer in interface OrderItem

unmarkForOffer

public boolean unmarkForOffer()
Specified by:
unmarkForOffer in interface OrderItem

isAllQuantityMarkedForOffer

public boolean isAllQuantityMarkedForOffer()
Specified by:
isAllQuantityMarkedForOffer in interface OrderItem

getPersonalMessage

public PersonalMessage getPersonalMessage()
Specified by:
getPersonalMessage in interface OrderItem

setPersonalMessage

public void setPersonalMessage(PersonalMessage personalMessage)
Specified by:
setPersonalMessage in interface OrderItem

getOrder

public Order getOrder()
Specified by:
getOrder in interface OrderItem

setOrder

public void setOrder(Order order)
Specified by:
setOrder in interface OrderItem

getId

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

setId

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

getName

public java.lang.String getName()
Specified by:
getName in interface OrderItem

setName

public void setName(java.lang.String name)
Specified by:
setName in interface OrderItem

isInCategory

public boolean isInCategory(java.lang.String categoryName)
Specified by:
isInCategory in interface OrderItem

getOrderItemAdjustments

public java.util.List<OrderItemAdjustment> getOrderItemAdjustments()
Description copied from interface: OrderItem
Returns a unmodifiable List of OrderItemAdjustment. To modify the List of OrderItemAdjustment, please use the addOrderItemAdjustment or removeAllAdjustments methods.

Specified by:
getOrderItemAdjustments in interface OrderItem
Returns:
a unmodifiable List of OrderItemAdjustment

addOrderItemAdjustment

public void addOrderItemAdjustment(OrderItemAdjustment orderItemAdjustment)
Description copied from interface: OrderItem
Adds the adjustment to the order item's adjustment list and discounts the order item's adjustment price by the value of the adjustment.

Specified by:
addOrderItemAdjustment in interface OrderItem

removeAllAdjustments

public int removeAllAdjustments()
Description copied from interface: OrderItem
Removes all adjustment for this order item and reset the adjustment price.

Specified by:
removeAllAdjustments in interface OrderItem

setOrderItemAdjustments

public void setOrderItemAdjustments(java.util.List<OrderItemAdjustment> orderItemAdjustments)

getAdjustmentValue

public Money getAdjustmentValue()
Specified by:
getAdjustmentValue in interface OrderItem

getAdjustmentPrice

@Deprecated
public Money getAdjustmentPrice()
Deprecated. 

Specified by:
getAdjustmentPrice in interface OrderItem

setAdjustmentPrice

@Deprecated
public void setAdjustmentPrice(Money adjustmentPrice)
Deprecated. 

Specified by:
setAdjustmentPrice in interface OrderItem

getGiftWrapOrderItem

public GiftWrapOrderItem getGiftWrapOrderItem()
Specified by:
getGiftWrapOrderItem in interface OrderItem

setGiftWrapOrderItem

public void setGiftWrapOrderItem(GiftWrapOrderItem giftWrapOrderItem)
Specified by:
setGiftWrapOrderItem in interface OrderItem

getOrderItemType

public OrderItemType getOrderItemType()
Specified by:
getOrderItemType in interface OrderItem

setOrderItemType

public void setOrderItemType(OrderItemType orderItemType)
Specified by:
setOrderItemType in interface OrderItem

getIsOnSale

public boolean getIsOnSale()
Specified by:
getIsOnSale in interface OrderItem

getIsDiscounted

public boolean getIsDiscounted()
Specified by:
getIsDiscounted in interface OrderItem

isNotCombinableOfferApplied

public boolean isNotCombinableOfferApplied()
Specified by:
isNotCombinableOfferApplied in interface OrderItem

isHasOrderItemAdjustments

public boolean isHasOrderItemAdjustments()
Specified by:
isHasOrderItemAdjustments in interface OrderItem

updatePrices

public boolean updatePrices()
Specified by:
updatePrices in interface OrderItem

getPromotionDiscounts

public java.util.List<PromotionDiscount> getPromotionDiscounts()
Specified by:
getPromotionDiscounts in interface OrderItem

setPromotionDiscounts

public void setPromotionDiscounts(java.util.List<PromotionDiscount> promotionDiscounts)
Specified by:
setPromotionDiscounts in interface OrderItem

getPromotionQualifiers

public java.util.List<PromotionQualifier> getPromotionQualifiers()
Specified by:
getPromotionQualifiers in interface OrderItem

setPromotionQualifiers

public void setPromotionQualifiers(java.util.List<PromotionQualifier> promotionQualifiers)
Specified by:
setPromotionQualifiers in interface OrderItem

getQuantityAvailableToBeUsedAsQualifier

public int getQuantityAvailableToBeUsedAsQualifier(Offer promotion)
Specified by:
getQuantityAvailableToBeUsedAsQualifier in interface OrderItem

getQuantityAvailableToBeUsedAsTarget

public int getQuantityAvailableToBeUsedAsTarget(Offer promotion)
Specified by:
getQuantityAvailableToBeUsedAsTarget in interface OrderItem

addPromotionQualifier

public void addPromotionQualifier(CandidateItemOffer candidatePromotion,
                                  OfferItemCriteria itemCriteria,
                                  int quantity)
Specified by:
addPromotionQualifier in interface OrderItem

addPromotionDiscount

public void addPromotionDiscount(CandidateItemOffer candidatePromotion,
                                 OfferItemCriteria itemCriteria,
                                 int quantity)
Specified by:
addPromotionDiscount in interface OrderItem

lookupOrCreatePromotionQualifier

protected PromotionQualifier lookupOrCreatePromotionQualifier(CandidateItemOffer candidatePromotion)

lookupOrCreatePromotionDiscount

protected PromotionDiscount lookupOrCreatePromotionDiscount(CandidateItemOffer candidatePromotion)

clearAllNonFinalizedQuantities

public void clearAllNonFinalizedQuantities()
Specified by:
clearAllNonFinalizedQuantities in interface OrderItem

clearAllDiscount

public void clearAllDiscount()
Specified by:
clearAllDiscount in interface OrderItem

clearAllQualifiers

public void clearAllQualifiers()
Specified by:
clearAllQualifiers in interface OrderItem

clearAllNonFinalizedDiscounts

protected void clearAllNonFinalizedDiscounts()

clearAllNonFinalizedQualifiers

protected void clearAllNonFinalizedQualifiers()

finalizeQuantities

public void finalizeQuantities()
Specified by:
finalizeQuantities in interface OrderItem

getPromotionDiscountMismatchQuantity

protected int getPromotionDiscountMismatchQuantity()

checkCloneable

public void checkCloneable(OrderItem orderItem)
                    throws java.lang.CloneNotSupportedException,
                           java.lang.SecurityException,
                           java.lang.NoSuchMethodException
Throws:
java.lang.CloneNotSupportedException
java.lang.SecurityException
java.lang.NoSuchMethodException

clone

public OrderItem clone()
Specified by:
clone in interface OrderItem
Overrides:
clone in class java.lang.Object

split

public java.util.List<OrderItem> split()
Specified by:
split in interface OrderItem

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 © 2011. All Rights Reserved.