org.broadleafcommerce.core.order.domain
Class OrderItemImpl

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

@Entity
public class OrderItemImpl
extends Object
implements OrderItem, Cloneable

See Also:
Serialized Form

Field Summary
protected  List<CandidateItemOffer> candidateItemOffers
           
protected  Category category
           
protected  GiftWrapOrderItem giftWrapOrderItem
           
protected  Long id
           
protected  Boolean itemTaxable
           
protected  String name
           
protected  Order order
           
protected  List<OrderItemAdjustment> orderItemAdjustments
           
protected  Map<String,OrderItemAttribute> orderItemAttributeMap
           
protected  String orderItemType
           
protected  PersonalMessage personalMessage
           
protected  BigDecimal price
           
protected  int quantity
           
protected  BigDecimal retailPrice
           
protected  BigDecimal salePrice
           
protected  Long splitParentItemId
           
 
Constructor Summary
OrderItemImpl()
           
 
Method Summary
 void accept(OrderItemVisitor visitor)
           
 void addCandidateItemOffer(CandidateItemOffer candidateItemOffer)
           
 void assignFinalPrice()
           
 void checkCloneable(OrderItem orderItem)
           
 OrderItem clone()
           
 boolean equals(Object obj)
           
 Money getAdjustmentValue()
           
 List<CandidateItemOffer> getCandidateItemOffers()
           
 Category getCategory()
           
 Money getCurrentPrice()
           
 GiftWrapOrderItem getGiftWrapOrderItem()
           
 Long getId()
           
 boolean getIsDiscounted()
           
 boolean getIsOnSale()
           
 String getName()
           
 Order getOrder()
           
 List<OrderItemAdjustment> getOrderItemAdjustments()
          Returns a unmodifiable List of OrderItemAdjustment.
 Map<String,OrderItemAttribute> getOrderItemAttributes()
          A list of arbitrary attributes added to this item.
 OrderItemType getOrderItemType()
           
 PersonalMessage getPersonalMessage()
           
 Money getPrice()
           
 Money getPriceBeforeAdjustments(boolean allowSalesPrice)
           
 int getQuantity()
           
 Money getRetailPrice()
           
 Money getSalePrice()
           
 Long getSplitParentItemId()
          If the system automatically split an item to accommodate the promotion logic (e.g.
 Money getTaxablePrice()
           
 int hashCode()
           
 boolean isInCategory(String categoryName)
           
 Boolean isTaxable()
          Returns whether or not this item is taxable.
 int removeAllAdjustments()
          Removes all adjustment for this order item and reset the adjustment price.
 void removeAllCandidateItemOffers()
           
 void setCandidateItemOffers(List<CandidateItemOffer> candidateItemOffers)
           
 void setCategory(Category category)
           
 void setGiftWrapOrderItem(GiftWrapOrderItem giftWrapOrderItem)
           
 void setId(Long id)
           
 void setName(String name)
           
 void setOrder(Order order)
           
 void setOrderItemAdjustments(List<OrderItemAdjustment> orderItemAdjustments)
           
 void setOrderItemAttributes(Map<String,OrderItemAttribute> orderItemAttributes)
          Sets the map of order item attributes.
 void setOrderItemType(OrderItemType orderItemType)
           
 void setPersonalMessage(PersonalMessage personalMessage)
           
 void setPrice(Money finalPrice)
           
 void setQuantity(int quantity)
           
 void setRetailPrice(Money retailPrice)
           
 void setSalePrice(Money salePrice)
           
 void setSplitParentItemId(Long splitParentItemId)
           
 void setTaxable(Boolean taxable)
          Sets whether or not this item is taxable
 boolean updatePrices()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected Long id

category

protected Category category

order

protected Order order

retailPrice

protected BigDecimal retailPrice

salePrice

protected BigDecimal salePrice

price

protected BigDecimal price

quantity

protected int quantity

name

protected String name

personalMessage

protected PersonalMessage personalMessage

giftWrapOrderItem

protected GiftWrapOrderItem giftWrapOrderItem

orderItemAdjustments

protected List<OrderItemAdjustment> orderItemAdjustments

candidateItemOffers

protected List<CandidateItemOffer> candidateItemOffers

orderItemType

protected String orderItemType

itemTaxable

protected Boolean itemTaxable

orderItemAttributeMap

protected Map<String,OrderItemAttribute> orderItemAttributeMap

splitParentItemId

protected Long splitParentItemId
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

getTaxablePrice

public Money getTaxablePrice()
Specified by:
getTaxablePrice 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 List<CandidateItemOffer> getCandidateItemOffers()
Specified by:
getCandidateItemOffers in interface OrderItem

setCandidateItemOffers

public void setCandidateItemOffers(List<CandidateItemOffer> candidateItemOffers)
Specified by:
setCandidateItemOffers 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 Long getId()
Specified by:
getId in interface OrderItem

setId

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

getName

public String getName()
Specified by:
getName in interface OrderItem

setName

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

isInCategory

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

getOrderItemAdjustments

public 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

setOrderItemAdjustments

public void setOrderItemAdjustments(List<OrderItemAdjustment> orderItemAdjustments)
Specified by:
setOrderItemAdjustments in interface OrderItem

getAdjustmentValue

public Money getAdjustmentValue()
Specified by:
getAdjustmentValue 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

updatePrices

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

assignFinalPrice

public void assignFinalPrice()
Specified by:
assignFinalPrice 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

addCandidateItemOffer

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

removeAllCandidateItemOffers

public void removeAllCandidateItemOffers()
Specified by:
removeAllCandidateItemOffers 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

getOrderItemAttributes

public Map<String,OrderItemAttribute> getOrderItemAttributes()
A list of arbitrary attributes added to this item.

Specified by:
getOrderItemAttributes in interface OrderItem

setOrderItemAttributes

public void setOrderItemAttributes(Map<String,OrderItemAttribute> orderItemAttributes)
Sets the map of order item attributes.

Specified by:
setOrderItemAttributes in interface OrderItem
Parameters:
orderItemAttributes -

checkCloneable

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

clone

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

accept

public void accept(OrderItemVisitor visitor)
            throws PricingException
Specified by:
accept in interface OrderItem
Throws:
PricingException

isTaxable

public Boolean isTaxable()
Description copied from interface: OrderItem
Returns whether or not this item is taxable. If this flag is not set, it returns true by default

Specified by:
isTaxable in interface OrderItem
Returns:
the taxable flag. If null, returns true

setTaxable

public void setTaxable(Boolean taxable)
Description copied from interface: OrderItem
Sets whether or not this item is taxable

Specified by:
setTaxable in interface OrderItem

getSplitParentItemId

public Long getSplitParentItemId()
Description copied from interface: OrderItem
If the system automatically split an item to accommodate the promotion logic (e.g. buy one get one free), then this value is set to the originalItemId. Returns null otherwise.

Specified by:
getSplitParentItemId in interface OrderItem
Returns:

setSplitParentItemId

public void setSplitParentItemId(Long splitParentItemId)
Specified by:
setSplitParentItemId in interface OrderItem


Copyright © 2013. All Rights Reserved.