org.broadleafcommerce.core.order.service.manipulation
Class DiscreteOrderItemDecorator

java.lang.Object
  extended by org.broadleafcommerce.core.order.service.manipulation.DiscreteOrderItemDecorator
All Implemented Interfaces:
Serializable, DiscreteOrderItem, OrderItem, SkuAccessor

public class DiscreteOrderItemDecorator
extends Object
implements DiscreteOrderItem

See Also:
Serialized Form

Constructor Summary
DiscreteOrderItemDecorator(DiscreteOrderItem discreteOrderItem, int quantity)
           
 
Method Summary
 void accept(OrderItemVisitor visitor)
           
 void addCandidateItemOffer(CandidateItemOffer candidateItemOffer)
           
 void assignFinalPrice()
           
 OrderItem clone()
           
 Map<String,String> getAdditionalAttributes()
           
 Money getAdjustmentValue()
           
 Money getBaseRetailPrice()
           
 Money getBaseSalePrice()
           
 BundleOrderItem getBundleOrderItem()
          If this item is part of a bundle, this method will return the containing bundle item.
 List<CandidateItemOffer> getCandidateItemOffers()
           
 Category getCategory()
           
 Money getCurrentPrice()
           
 List<DiscreteOrderItemFeePrice> getDiscreteOrderItemFeePrices()
           
 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)
           
 Product getProduct()
           
 int getQuantity()
           
 Money getRetailPrice()
           
 Money getSalePrice()
           
 Sku getSku()
           
 SkuBundleItem getSkuBundleItem()
          If this item is part of a bundle that was created via a ProductBundle, then this method returns a reference to the corresponding SkuBundleItem.
 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 setAdditionalAttributes(Map<String,String> additionalAttributes)
           
 void setBaseRetailPrice(Money baseRetailPrice)
           
 void setBaseSalePrice(Money baseSalePrice)
           
 void setBundleOrderItem(BundleOrderItem bundleOrderItem)
          Sets the parent bundle item.
 void setCandidateItemOffers(List<CandidateItemOffer> candidateItemOffers)
           
 void setCategory(Category category)
           
 void setDiscreteOrderItemFeePrices(List<DiscreteOrderItemFeePrice> orderItemFeePrices)
           
 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)
           
 void setProduct(Product product)
           
 void setQuantity(int quantity)
           
 void setRetailPrice(Money retailPrice)
           
 void setSalePrice(Money salePrice)
           
 void setSku(Sku sku)
           
 void setSkuBundleItem(SkuBundleItem skuBundleItem)
          Sets the associated skuBundleItem.
 void setSplitParentItemId(Long id)
           
 void setTaxable(Boolean taxable)
          Sets whether or not this item is taxable
 boolean updatePrices()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiscreteOrderItemDecorator

public DiscreteOrderItemDecorator(DiscreteOrderItem discreteOrderItem,
                                  int quantity)
Method Detail

getSku

public Sku getSku()
Specified by:
getSku in interface DiscreteOrderItem
Specified by:
getSku in interface SkuAccessor

setSku

public void setSku(Sku sku)
Specified by:
setSku in interface DiscreteOrderItem

getProduct

public Product getProduct()
Specified by:
getProduct in interface DiscreteOrderItem

setProduct

public void setProduct(Product product)
Specified by:
setProduct in interface DiscreteOrderItem

getBundleOrderItem

public BundleOrderItem getBundleOrderItem()
Description copied from interface: DiscreteOrderItem
If this item is part of a bundle, this method will return the containing bundle item.

Specified by:
getBundleOrderItem in interface DiscreteOrderItem
Returns:

setBundleOrderItem

public void setBundleOrderItem(BundleOrderItem bundleOrderItem)
Description copied from interface: DiscreteOrderItem
Sets the parent bundle item. Setting to null removes this item from the bundle.

Specified by:
setBundleOrderItem in interface DiscreteOrderItem

getSkuBundleItem

public SkuBundleItem getSkuBundleItem()
If this item is part of a bundle that was created via a ProductBundle, then this method returns a reference to the corresponding SkuBundleItem.

For manually created

For all others, this method returns null.

Specified by:
getSkuBundleItem in interface DiscreteOrderItem
Returns:

setSkuBundleItem

public void setSkuBundleItem(SkuBundleItem skuBundleItem)
Sets the associated skuBundleItem.

Specified by:
setSkuBundleItem in interface DiscreteOrderItem
Parameters:
skuBundleItem -

getTaxablePrice

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

getAdditionalAttributes

public Map<String,String> getAdditionalAttributes()
Specified by:
getAdditionalAttributes in interface DiscreteOrderItem

setAdditionalAttributes

public void setAdditionalAttributes(Map<String,String> additionalAttributes)
Specified by:
setAdditionalAttributes in interface DiscreteOrderItem

getBaseRetailPrice

public Money getBaseRetailPrice()
Specified by:
getBaseRetailPrice in interface DiscreteOrderItem

setBaseRetailPrice

public void setBaseRetailPrice(Money baseRetailPrice)
Specified by:
setBaseRetailPrice in interface DiscreteOrderItem

getId

public Long getId()
Specified by:
getId in interface OrderItem

setId

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

getBaseSalePrice

public Money getBaseSalePrice()
Specified by:
getBaseSalePrice in interface DiscreteOrderItem

getOrder

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

setBaseSalePrice

public void setBaseSalePrice(Money baseSalePrice)
Specified by:
setBaseSalePrice in interface DiscreteOrderItem

setOrder

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

getRetailPrice

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

getDiscreteOrderItemFeePrices

public List<DiscreteOrderItemFeePrice> getDiscreteOrderItemFeePrices()
Specified by:
getDiscreteOrderItemFeePrices in interface DiscreteOrderItem

setRetailPrice

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

getSalePrice

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

setDiscreteOrderItemFeePrices

public void setDiscreteOrderItemFeePrices(List<DiscreteOrderItemFeePrice> orderItemFeePrices)
Specified by:
setDiscreteOrderItemFeePrices in interface DiscreteOrderItem

setSalePrice

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

getAdjustmentValue

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

getPrice

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

setPrice

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

assignFinalPrice

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

getCurrentPrice

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

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

getPersonalMessage

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

setPersonalMessage

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

isInCategory

public boolean isInCategory(String categoryName)
Specified by:
isInCategory 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

getName

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

setName

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

getPriceBeforeAdjustments

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

clone

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

setOrderItemAdjustments

public void setOrderItemAdjustments(List<OrderItemAdjustment> orderItemAdjustments)
Specified by:
setOrderItemAdjustments 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

accept

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

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 -

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()
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 id)
Specified by:
setSplitParentItemId in interface OrderItem


Copyright © 2013. All Rights Reserved.