org.broadleafcommerce.core.order.domain
Class NullOrderImpl

java.lang.Object
  extended by org.broadleafcommerce.core.order.domain.NullOrderImpl
All Implemented Interfaces:
Serializable, Order

public class NullOrderImpl
extends Object
implements Order

NullOrderImpl is a class that represents an unmodifiable, empty order. This class is used as the default order for a customer. It is a shared class between customers, and serves as a placeholder order until an item is initially added to cart, at which point a real Order gets created. This prevents creating individual orders for customers that are just browsing the site.

Author:
apazzolini
See Also:
Serialized Form

Constructor Summary
NullOrderImpl()
           
 
Method Summary
 void addAddedOfferCode(OfferCode offerCode)
           
 void addOfferCode(OfferCode addedOfferCode)
           
 void addOrderItem(OrderItem orderItem)
           
 void assignOrderItemsFinalPrice()
           
 Money calculateOrderItemsFinalPrice(boolean includeNonTaxableItems)
           
 boolean containsSku(Sku sku)
          Checks the DiscreteOrderItems in the cart and returns whether or not the given SKU was found.
 List<OfferCode> getAddedOfferCodes()
           
 Map<Offer,OfferInfo> getAdditionalOfferInformation()
           
 Auditable getAuditable()
           
 List<CandidateOrderOffer> getCandidateOrderOffers()
           
 Customer getCustomer()
           
 List<DiscreteOrderItem> getDiscreteOrderItems()
           
 String getEmailAddress()
           
 Money getFulfillmentGroupAdjustmentsValue()
           
 List<FulfillmentGroup> getFulfillmentGroups()
           
 String getFulfillmentStatus()
           
 Long getId()
           
 Money getItemAdjustmentsValue()
          Returns the discount value of all the applied item offers for this order.
 int getItemCount()
          This method returns the total number of items in this order.
 String getName()
           
 List<OrderAdjustment> getOrderAdjustments()
          Returns a unmodifiable List of OrderAdjustment.
 Money getOrderAdjustmentsValue()
          Returns the discount value of all the applied order offers.
 Map<String,OrderAttribute> getOrderAttributes()
          A list of arbitrary attributes added to this order.
 List<OrderItem> getOrderItems()
           
 String getOrderNumber()
           
 List<PaymentInfo> getPaymentInfos()
           
 Money getRemainingTotal()
           
 OrderStatus getStatus()
           
 Date getSubmitDate()
           
 Money getSubTotal()
          Returns the subtotal price for the order.
 Money getTotal()
           
 Money getTotalAdjustmentsValue()
          Returns the total discount value for all applied item and order offers in the order.
 Money getTotalShipping()
           
 Money getTotalTax()
          Gets the total tax for this order, which is the sum of the taxes on all fulfillment groups.
 boolean hasCategoryItem(String categoryName)
           
 void setAdditionalOfferInformation(Map<Offer,OfferInfo> additionalOfferInformation)
           
 void setAuditable(Auditable auditable)
           
 void setCandidateOrderOffers(List<CandidateOrderOffer> candidateOrderOffers)
           
 void setCustomer(Customer customer)
           
 void setEmailAddress(String emailAddress)
           
 void setFulfillmentGroups(List<FulfillmentGroup> fulfillmentGroups)
           
 void setId(Long id)
           
 void setName(String name)
           
 void setOrderAttributes(Map<String,OrderAttribute> orderAttributes)
          Sets the map of order attributes.
 void setOrderItems(List<OrderItem> orderItems)
           
 void setOrderNumber(String orderNumber)
           
 void setPaymentInfos(List<PaymentInfo> paymentInfos)
           
 void setStatus(OrderStatus status)
           
 void setSubmitDate(Date submitDate)
           
 void setSubTotal(Money subTotal)
          Sets the subtotal price for the order.
 void setTotal(Money orderTotal)
           
 void setTotalShipping(Money totalShipping)
           
 void setTotalTax(Money totalTax)
          Sets the total tax of this order, which is the sum of the taxes on all fulfillment groups.
 boolean updatePrices()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullOrderImpl

public NullOrderImpl()
Method Detail

getId

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

setId

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

getName

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

setName

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

getAuditable

public Auditable getAuditable()
Specified by:
getAuditable in interface Order

setAuditable

public void setAuditable(Auditable auditable)
Specified by:
setAuditable in interface Order

getSubTotal

public Money getSubTotal()
Description copied from interface: Order
Returns the subtotal price for the order. The subtotal price is the price of all order items with item offers applied. The subtotal does not take into account the order offers or any taxes that apply to this order.

Specified by:
getSubTotal in interface Order
Returns:
the total item price with offers applied

setSubTotal

public void setSubTotal(Money subTotal)
Description copied from interface: Order
Sets the subtotal price for the order. The subtotal price is the price of all order items with item offers applied. The subtotal does not take into account the order offers or any taxes that apply to this order.

Specified by:
setSubTotal in interface Order

assignOrderItemsFinalPrice

public void assignOrderItemsFinalPrice()
Specified by:
assignOrderItemsFinalPrice in interface Order

calculateOrderItemsFinalPrice

public Money calculateOrderItemsFinalPrice(boolean includeNonTaxableItems)
Specified by:
calculateOrderItemsFinalPrice in interface Order

getTotal

public Money getTotal()
Specified by:
getTotal in interface Order

getRemainingTotal

public Money getRemainingTotal()
Specified by:
getRemainingTotal in interface Order

setTotal

public void setTotal(Money orderTotal)
Specified by:
setTotal in interface Order

getCustomer

public Customer getCustomer()
Specified by:
getCustomer in interface Order

setCustomer

public void setCustomer(Customer customer)
Specified by:
setCustomer in interface Order

getStatus

public OrderStatus getStatus()
Specified by:
getStatus in interface Order

setStatus

public void setStatus(OrderStatus status)
Specified by:
setStatus in interface Order

getOrderItems

public List<OrderItem> getOrderItems()
Specified by:
getOrderItems in interface Order

setOrderItems

public void setOrderItems(List<OrderItem> orderItems)
Specified by:
setOrderItems in interface Order

addOrderItem

public void addOrderItem(OrderItem orderItem)
Specified by:
addOrderItem in interface Order

getFulfillmentGroups

public List<FulfillmentGroup> getFulfillmentGroups()
Specified by:
getFulfillmentGroups in interface Order

setFulfillmentGroups

public void setFulfillmentGroups(List<FulfillmentGroup> fulfillmentGroups)
Specified by:
setFulfillmentGroups in interface Order

setCandidateOrderOffers

public void setCandidateOrderOffers(List<CandidateOrderOffer> candidateOrderOffers)
Specified by:
setCandidateOrderOffers in interface Order

getCandidateOrderOffers

public List<CandidateOrderOffer> getCandidateOrderOffers()
Specified by:
getCandidateOrderOffers in interface Order

getSubmitDate

public Date getSubmitDate()
Specified by:
getSubmitDate in interface Order

setSubmitDate

public void setSubmitDate(Date submitDate)
Specified by:
setSubmitDate in interface Order

getTotalTax

public Money getTotalTax()
Description copied from interface: Order
Gets the total tax for this order, which is the sum of the taxes on all fulfillment groups. This total is calculated in the TotalActivity stage of the pricing workflow.

Specified by:
getTotalTax in interface Order
Returns:
the total tax for the order

setTotalTax

public void setTotalTax(Money totalTax)
Description copied from interface: Order
Sets the total tax of this order, which is the sum of the taxes on all fulfillment groups. This total should only be set during the TotalActivity stage of the pricing workflow.

Specified by:
setTotalTax in interface Order

getTotalShipping

public Money getTotalShipping()
Specified by:
getTotalShipping in interface Order

setTotalShipping

public void setTotalShipping(Money totalShipping)
Specified by:
setTotalShipping in interface Order

getPaymentInfos

public List<PaymentInfo> getPaymentInfos()
Specified by:
getPaymentInfos in interface Order

setPaymentInfos

public void setPaymentInfos(List<PaymentInfo> paymentInfos)
Specified by:
setPaymentInfos in interface Order

hasCategoryItem

public boolean hasCategoryItem(String categoryName)
Specified by:
hasCategoryItem in interface Order

getOrderAdjustments

public List<OrderAdjustment> getOrderAdjustments()
Description copied from interface: Order
Returns a unmodifiable List of OrderAdjustment. To modify the List of OrderAdjustment, please use the addOrderAdjustments or removeAllOrderAdjustments methods.

Specified by:
getOrderAdjustments in interface Order
Returns:
a unmodifiable List of OrderItemAdjustment

getDiscreteOrderItems

public List<DiscreteOrderItem> getDiscreteOrderItems()
Specified by:
getDiscreteOrderItems in interface Order

containsSku

public boolean containsSku(Sku sku)
Description copied from interface: Order
Checks the DiscreteOrderItems in the cart and returns whether or not the given SKU was found. The equality of the SKUs is based on the .equals() method in SkuImpl

Specified by:
containsSku in interface Order
Parameters:
sku - The sku to check for
Returns:
whether or not the given SKU exists in the cart

getAddedOfferCodes

public List<OfferCode> getAddedOfferCodes()
Specified by:
getAddedOfferCodes in interface Order

getFulfillmentStatus

public String getFulfillmentStatus()
Specified by:
getFulfillmentStatus in interface Order

getOrderNumber

public String getOrderNumber()
Specified by:
getOrderNumber in interface Order

setOrderNumber

public void setOrderNumber(String orderNumber)
Specified by:
setOrderNumber in interface Order

getEmailAddress

public String getEmailAddress()
Specified by:
getEmailAddress in interface Order

setEmailAddress

public void setEmailAddress(String emailAddress)
Specified by:
setEmailAddress in interface Order

getAdditionalOfferInformation

public Map<Offer,OfferInfo> getAdditionalOfferInformation()
Specified by:
getAdditionalOfferInformation in interface Order

setAdditionalOfferInformation

public void setAdditionalOfferInformation(Map<Offer,OfferInfo> additionalOfferInformation)
Specified by:
setAdditionalOfferInformation in interface Order

getItemAdjustmentsValue

public Money getItemAdjustmentsValue()
Description copied from interface: Order
Returns the discount value of all the applied item offers for this order. The value is already deducted from the order subTotal.

Specified by:
getItemAdjustmentsValue in interface Order
Returns:
the discount value of all the applied item offers for this order

getOrderAdjustmentsValue

public Money getOrderAdjustmentsValue()
Description copied from interface: Order
Returns the discount value of all the applied order offers. The value returned from this method should be subtracted from the getSubTotal() to get the order price with all item and order offers applied.

Specified by:
getOrderAdjustmentsValue in interface Order
Returns:
the discount value of all applied order offers.

getTotalAdjustmentsValue

public Money getTotalAdjustmentsValue()
Description copied from interface: Order
Returns the total discount value for all applied item and order offers in the order. The return value should not be used with getSubTotal() to calculate the final price, since getSubTotal() already takes into account the applied item offers.

Specified by:
getTotalAdjustmentsValue in interface Order
Returns:
the total discount of all applied item and order offers

updatePrices

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

getFulfillmentGroupAdjustmentsValue

public Money getFulfillmentGroupAdjustmentsValue()
Specified by:
getFulfillmentGroupAdjustmentsValue in interface Order

addOfferCode

public void addOfferCode(OfferCode addedOfferCode)
Specified by:
addOfferCode in interface Order

addAddedOfferCode

public void addAddedOfferCode(OfferCode offerCode)
Specified by:
addAddedOfferCode in interface Order

getOrderAttributes

public Map<String,OrderAttribute> getOrderAttributes()
Description copied from interface: Order
A list of arbitrary attributes added to this order.

Specified by:
getOrderAttributes in interface Order

setOrderAttributes

public void setOrderAttributes(Map<String,OrderAttribute> orderAttributes)
Description copied from interface: Order
Sets the map of order attributes.

Specified by:
setOrderAttributes in interface Order

getItemCount

public int getItemCount()
Description copied from interface: Order
This method returns the total number of items in this order. It iterates through all of the discrete order items and sums up the quantity. This method is useful for display to the customer the current number of "physical" items in the cart

Specified by:
getItemCount in interface Order
Returns:
the number of items in the order


Copyright © 2012. All Rights Reserved.