org.broadleafcommerce.core.order.domain
Class DiscreteOrderItemImpl

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

@Entity
public class DiscreteOrderItemImpl
extends OrderItemImpl
implements DiscreteOrderItem

See Also:
Serialized Form

Field Summary
protected  Map<String,String> additionalAttributes
           
protected  BigDecimal baseRetailPrice
           
protected  BigDecimal baseSalePrice
           
protected  BundleOrderItem bundleOrderItem
           
protected  List<DiscreteOrderItemFeePrice> discreteOrderItemFeePrices
           
protected  Product product
           
protected  Sku sku
           
protected  SkuBundleItem skuBundleItem
           
 
Fields inherited from class org.broadleafcommerce.core.order.domain.OrderItemImpl
candidateItemOffers, category, discountsAllowed, giftWrapOrderItem, id, itemTaxable, name, order, orderItemAdjustments, orderItemAttributeMap, orderItemPriceDetails, orderItemQualifiers, orderItemType, personalMessage, price, quantity, retailPrice, retailPriceOverride, salePrice, salePriceOverride, totalTax
 
Constructor Summary
DiscreteOrderItemImpl()
           
 
Method Summary
 OrderItem clone()
           
protected  Money convertToMoney(BigDecimal amount)
           
 boolean equals(Object obj)
           
 BundleOrderItem findParentItem()
          For items that are part of a bundle, this method will return the parent bundle item.
 Map<String,String> getAdditionalAttributes()
           
 Money getBaseRetailPrice()
           
 Money getBaseSalePrice()
           
 BundleOrderItem getBundleOrderItem()
          If this item is part of a bundle, this method will return the containing bundle item.
 List<DiscreteOrderItemFeePrice> getDiscreteOrderItemFeePrices()
           
 String getName()
          Generally copied from the Sku.getName()
 Order getOrder()
          Reference back to the containing order.
 Product getProduct()
           
 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.
 int hashCode()
           
 boolean isDiscountingAllowed()
          If true, this item can be discounted..
 Boolean isTaxable()
          Returns whether or not this item is taxable.
 void setAdditionalAttributes(Map<String,String> additionalAttributes)
           
 void setBaseRetailPrice(Money baseRetailPrice)
           
 void setBaseSalePrice(Money baseSalePrice)
           
 void setBundleOrderItem(BundleOrderItem bundleOrderItem)
          Sets the parent bundle item.
 void setDiscreteOrderItemFeePrices(List<DiscreteOrderItemFeePrice> discreteOrderItemFeePrices)
           
 void setOrder(Order order)
          Sets the order for this orderItem.
 void setProduct(Product product)
           
 void setSku(Sku sku)
           
 void setSkuBundleItem(SkuBundleItem SkuBundleItem)
          Sets the associated SkuBundleItem.
 boolean updateSaleAndRetailPrices()
          Used to reset the base price of the item that the pricing engine uses.
 
Methods inherited from class org.broadleafcommerce.core.order.domain.OrderItemImpl
addCandidateItemOffer, assignFinalPrice, checkCloneable, convertOrderItemType, finalizePrice, getAdjustmentValue, getAverageAdjustmentValue, getAveragePrice, getCandidateItemOffers, getCategory, getGiftWrapOrderItem, getId, getIsDiscounted, getIsOnSale, getOrderItemAdjustments, getOrderItemAttributes, getOrderItemPriceDetails, getOrderItemQualifiers, getOrderItemType, getPersonalMessage, getPrice, getPriceBeforeAdjustments, getQuantity, getRetailPrice, getSalePrice, getTaxablePrice, getTotalAdjustmentValue, getTotalPrice, isInCategory, isRetailPriceOverride, isSalePriceOverride, removeAllAdjustments, removeAllCandidateItemOffers, setCandidateItemOffers, setCategory, setDiscountingAllowed, setGiftWrapOrderItem, setId, setName, setOrderItemAdjustments, setOrderItemAttributes, setOrderItemPriceDetails, setOrderItemQualifiers, setOrderItemType, setPersonalMessage, setPrice, setQuantity, setRetailPrice, setRetailPriceOverride, setSalePrice, setSalePriceOverride, setTaxable
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.broadleafcommerce.core.order.domain.DiscreteOrderItem
getTaxablePrice
 
Methods inherited from interface org.broadleafcommerce.core.order.domain.OrderItem
addCandidateItemOffer, assignFinalPrice, finalizePrice, getAdjustmentValue, getAverageAdjustmentValue, getAveragePrice, getCandidateItemOffers, getCategory, getGiftWrapOrderItem, getId, getIsDiscounted, getIsOnSale, getOrderItemAdjustments, getOrderItemAttributes, getOrderItemPriceDetails, getOrderItemQualifiers, getOrderItemType, getPersonalMessage, getPrice, getPriceBeforeAdjustments, getQuantity, getRetailPrice, getSalePrice, getTotalAdjustmentValue, getTotalPrice, isInCategory, isRetailPriceOverride, isSalePriceOverride, removeAllAdjustments, removeAllCandidateItemOffers, setCandidateItemOffers, setCategory, setDiscountingAllowed, setGiftWrapOrderItem, setId, setName, setOrderItemAdjustments, setOrderItemAttributes, setOrderItemPriceDetails, setOrderItemQualifiers, setOrderItemType, setPersonalMessage, setPrice, setQuantity, setRetailPrice, setRetailPriceOverride, setSalePrice, setSalePriceOverride, setTaxable
 

Field Detail

baseRetailPrice

protected BigDecimal baseRetailPrice

baseSalePrice

protected BigDecimal baseSalePrice

sku

protected Sku sku

product

protected Product product

bundleOrderItem

protected BundleOrderItem bundleOrderItem

skuBundleItem

protected SkuBundleItem skuBundleItem

additionalAttributes

protected Map<String,String> additionalAttributes

discreteOrderItemFeePrices

protected List<DiscreteOrderItemFeePrice> discreteOrderItemFeePrices
Constructor Detail

DiscreteOrderItemImpl

public DiscreteOrderItemImpl()
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

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
Overrides:
isTaxable in class OrderItemImpl
Returns:
the taxable flag. If null, returns true

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

setOrder

public void setOrder(Order order)
Description copied from interface: OrderItem
Sets the order for this orderItem.

Specified by:
setOrder in interface OrderItem
Overrides:
setOrder in class OrderItemImpl

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 -

getName

public String getName()
Description copied from interface: OrderItem
Generally copied from the Sku.getName()

Specified by:
getName in interface OrderItem
Overrides:
getName in class OrderItemImpl
Returns:

getOrder

public Order getOrder()
Description copied from interface: OrderItem
Reference back to the containing order.

Specified by:
getOrder in interface OrderItem
Overrides:
getOrder in class OrderItemImpl
Returns:

updateSaleAndRetailPrices

public boolean updateSaleAndRetailPrices()
Description copied from interface: OrderItem
Used to reset the base price of the item that the pricing engine uses. Generally, this will update the retailPrice and salePrice based on the corresponding value in the SKU. If the retail or sale price was manually set, this method will not change those prices. For non-manually set prices, prices can change based on system activities such as locale changes and customer authentication, this method is used to ensure that all cart items reflect the current base price before executing other pricing / adjustment operations. Other known scenarios that can effect the base prices include the automatic bundling or loading a stale cart from the database. See notes in subclasses for specific behavior of this method.

Specified by:
updateSaleAndRetailPrices in interface OrderItem
Overrides:
updateSaleAndRetailPrices in class OrderItemImpl
Returns:
true if the base prices changed as a result of this call

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

getBaseSalePrice

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

setBaseSalePrice

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

getDiscreteOrderItemFeePrices

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

setDiscreteOrderItemFeePrices

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

convertToMoney

protected Money convertToMoney(BigDecimal amount)
Overrides:
convertToMoney in class OrderItemImpl

clone

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

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class OrderItemImpl

isDiscountingAllowed

public boolean isDiscountingAllowed()
Description copied from interface: OrderItem
If true, this item can be discounted..

Specified by:
isDiscountingAllowed in interface OrderItem
Overrides:
isDiscountingAllowed in class OrderItemImpl

findParentItem

public BundleOrderItem findParentItem()
Description copied from interface: DiscreteOrderItem
For items that are part of a bundle, this method will return the parent bundle item. Otherwise, returns null.

Specified by:
findParentItem in interface DiscreteOrderItem
Returns:


Copyright © 2013. All Rights Reserved.