org.broadleafcommerce.core.order.domain
Interface OrderItem

All Superinterfaces:
Serializable
All Known Subinterfaces:
BundleOrderItem, DiscreteOrderItem, DynamicPriceDiscreteOrderItem, GiftWrapOrderItem
All Known Implementing Classes:
BundleOrderItemImpl, DiscreteOrderItemDecorator, DiscreteOrderItemImpl, DynamicPriceDiscreteOrderItemImpl, GiftWrapOrderItemImpl, OrderItemImpl

public interface OrderItem
extends Serializable


Method Summary
 void accept(OrderItemVisitor visitor)
           
 void addCandidateItemOffer(CandidateItemOffer candidateItemOffer)
           
 void assignFinalPrice()
           
 OrderItem clone()
           
 Money getAdjustmentValue()
          Summation of all of the adjustments associated with this OrderItem
 List<CandidateItemOffer> getCandidateItemOffers()
           
 Category getCategory()
           
 Money getCurrentPrice()
           
 GiftWrapOrderItem getGiftWrapOrderItem()
           
 Long getId()
           
 boolean getIsDiscounted()
          Whethe or not this
 boolean getIsOnSale()
          Default implementation uses getSalePrice() < getRetailPrice()
 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()
          The final price associated with this OrderItem.
 Money getPriceBeforeAdjustments(boolean allowSalesPrice)
           
 int getQuantity()
          The quantity of this OrderItem.
 Money getRetailPrice()
          The retail price of the item that was added to the Order at the time that this was added.
 Money getSalePrice()
           
 Long getSplitParentItemId()
          If the system automatically split an item to accommodate the promotion logic (e.g.
 Money getTaxablePrice()
           
 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 price)
          Sets the price of this OrderItem while taking into account all taxes, fees, promotions and whether or not the item is on sale.
 void setQuantity(int quantity)
           
 void setRetailPrice(Money retailPrice)
          Sets the retail price of the item at the time that it is added to the Order
 void setSalePrice(Money salePrice)
           
 void setSplitParentItemId(Long id)
           
 void setTaxable(Boolean taxable)
          Sets whether or not this item is taxable
 boolean updatePrices()
          Post-condition should be that getPrice() should be the most up-to-date.
 

Method Detail

getId

Long getId()

setId

void setId(Long id)

getOrder

Order getOrder()

setOrder

void setOrder(Order order)

getRetailPrice

Money getRetailPrice()
The retail price of the item that was added to the Order at the time that this was added. This is preferable to use as opposed to checking the price of the item that was added from the catalog domain (like in DiscreteOrderItem, using DiscreteOrderItem.getSku()'s retail price) since the price in the catalog domain could have changed since the item was added to the Order.

Returns:

setRetailPrice

void setRetailPrice(Money retailPrice)
Sets the retail price of the item at the time that it is added to the Order

Parameters:
retailPrice -

getSalePrice

Money getSalePrice()
Returns:

setSalePrice

void setSalePrice(Money salePrice)

getAdjustmentValue

Money getAdjustmentValue()
Summation of all of the adjustments associated with this OrderItem

Returns:

getPrice

Money getPrice()
The final price associated with this OrderItem. Note that this takes into account all of the taxes, fees and promotions that are applied on this OrderItem. This will also use getSalePrice() as a base rather than getRetailPrice() when getIsOnSale() is true.

Returns:

setPrice

void setPrice(Money price)
Sets the price of this OrderItem while taking into account all taxes, fees, promotions and whether or not the item is on sale.

Parameters:
price -

getQuantity

int getQuantity()
The quantity of this OrderItem.

Returns:

setQuantity

void setQuantity(int quantity)

getCategory

Category getCategory()

setCategory

void setCategory(Category category)

getCandidateItemOffers

List<CandidateItemOffer> getCandidateItemOffers()

setCandidateItemOffers

void setCandidateItemOffers(List<CandidateItemOffer> candidateItemOffers)

getOrderItemAdjustments

List<OrderItemAdjustment> getOrderItemAdjustments()
Returns a unmodifiable List of OrderItemAdjustment. To modify the List of OrderItemAdjustment, please use the addOrderItemAdjustment or removeAllAdjustments methods.

Returns:
a unmodifiable List of OrderItemAdjustment

setOrderItemAdjustments

void setOrderItemAdjustments(List<OrderItemAdjustment> orderItemAdjustments)

getPersonalMessage

PersonalMessage getPersonalMessage()

setPersonalMessage

void setPersonalMessage(PersonalMessage personalMessage)

isInCategory

boolean isInCategory(String categoryName)

getGiftWrapOrderItem

GiftWrapOrderItem getGiftWrapOrderItem()

setGiftWrapOrderItem

void setGiftWrapOrderItem(GiftWrapOrderItem giftWrapOrderItem)

getOrderItemType

OrderItemType getOrderItemType()

setOrderItemType

void setOrderItemType(OrderItemType orderItemType)

getTaxablePrice

Money getTaxablePrice()

getIsOnSale

boolean getIsOnSale()
Default implementation uses getSalePrice() < getRetailPrice()

Returns:

getIsDiscounted

boolean getIsDiscounted()
Whethe or not this

Returns:

updatePrices

boolean updatePrices()
Post-condition should be that getPrice() should be the most up-to-date.

Returns:

getName

String getName()

setName

void setName(String name)

clone

OrderItem clone()

assignFinalPrice

void assignFinalPrice()

getCurrentPrice

Money getCurrentPrice()

getPriceBeforeAdjustments

Money getPriceBeforeAdjustments(boolean allowSalesPrice)

addCandidateItemOffer

void addCandidateItemOffer(CandidateItemOffer candidateItemOffer)

removeAllCandidateItemOffers

void removeAllCandidateItemOffers()

removeAllAdjustments

int removeAllAdjustments()
Removes all adjustment for this order item and reset the adjustment price.


accept

void accept(OrderItemVisitor visitor)
            throws PricingException
Throws:
PricingException

getOrderItemAttributes

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


setOrderItemAttributes

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

Parameters:
orderItemAttributes -

isTaxable

Boolean isTaxable()
Returns whether or not this item is taxable. If this flag is not set, it returns true by default

Returns:
the taxable flag. If null, returns true

setTaxable

void setTaxable(Boolean taxable)
Sets whether or not this item is taxable

Parameters:
taxable -

getSplitParentItemId

Long getSplitParentItemId()
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.

Returns:

setSplitParentItemId

void setSplitParentItemId(Long id)


Copyright © 2013. All Rights Reserved.