atg.commerce.order
Class OrderMergeEvent

java.lang.Object
  extended by atg.commerce.order.OrderMergeEvent

public class OrderMergeEvent
extends java.lang.Object

A Java event indicating that one order was merged into another. This can happen when a user visits the store anonymously, adds some items to the shopping cart, and then logs in. If the user previously had an incomplete order with items in the shopping cart, the items in the anonymous order will be merged into the previously saved order, the anonymous order discarded, and the modified order updated in the database.

In this case, an OrderMergeEvent will be generated just before the anonymous order is discarded. The event provides access to both the source order and destination order for the merge, and a flag indicating whether the source order will be deleted as part of the merge operation.

Event listeners may modifiy the destination order if they wish and their modifications will be persisted when the order is updated.


Field Summary
static java.lang.String CLASS_VERSION
           
protected  Order mDestinationOrder
           
protected  int mHashCode
           
protected  Order mSourceOrder
           
protected  boolean mWillDeleteSource
           
 
Constructor Summary
OrderMergeEvent(Order pSourceOrder, Order pDestinationOrder, boolean pWillDeleteSource)
          Construct a new OrderMergeEvent for a given source and destination order and delete-source mode.
 
Method Summary
 boolean equals(java.lang.Object pOther)
          Return true if another object is semantically equal to this one, meaning that they are both instances of OrderMergeEvent, and that they reflect the same source and destination orders and the same value for willDeleteSource.
 Order getDestinationOrder()
          Return the destination order for the merge operation.
 Order getSourceOrder()
          Return the source order for the merge operation.
 int hashCode()
          Constructs a hashcode that is unique for non-equivalent instances of this class.
 boolean isWillDeleteSource()
          Query whether or not the source order will be deleted after the merge.
protected  boolean sameOrder(Order pThisOrder, Order pThatOrder)
          Return true if two orders are considered to be the same, meaning either they are both null or they are both non-null and have the same order id.
 java.lang.String toString()
          Return a human readable representation of this event.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
See Also:
Constant Field Values

mSourceOrder

protected Order mSourceOrder

mDestinationOrder

protected Order mDestinationOrder

mWillDeleteSource

protected boolean mWillDeleteSource

mHashCode

protected int mHashCode
Constructor Detail

OrderMergeEvent

public OrderMergeEvent(Order pSourceOrder,
                       Order pDestinationOrder,
                       boolean pWillDeleteSource)
Construct a new OrderMergeEvent for a given source and destination order and delete-source mode. The source order is the order that commerce items, shipping groups, and payment information come from, while the destination order is the order they are being merged into.

Method Detail

getSourceOrder

public Order getSourceOrder()
Return the source order for the merge operation.


getDestinationOrder

public Order getDestinationOrder()
Return the destination order for the merge operation.


isWillDeleteSource

public boolean isWillDeleteSource()
Query whether or not the source order will be deleted after the merge.


equals

public boolean equals(java.lang.Object pOther)
Return true if another object is semantically equal to this one, meaning that they are both instances of OrderMergeEvent, and that they reflect the same source and destination orders and the same value for willDeleteSource.

Overrides:
equals in class java.lang.Object

sameOrder

protected boolean sameOrder(Order pThisOrder,
                            Order pThatOrder)
Return true if two orders are considered to be the same, meaning either they are both null or they are both non-null and have the same order id.


hashCode

public int hashCode()
Constructs a hashcode that is unique for non-equivalent instances of this class.

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Return a human readable representation of this event.

Overrides:
toString in class java.lang.Object