/** * Constructs a product node event. * * @param sourceNode The product node on which the Event initially occurred. * @param type the event type * @param nodeGroup If event type is NODE_ADDED or NODE_REMOVED this is the parent group to which the source * node was added to or removed from. */ public ProductNodeEvent(ProductNode sourceNode, int type, ProductNodeGroup nodeGroup) { super(sourceNode); this.nodeGroup = getNodeGroup(sourceNode, nodeGroup); this.propertyName = type == NODE_DATA_CHANGED ? "data" : null; this.type = type; this.oldValue = null; this.newValue = null; }
/** * Constructs a productEvent object. * * @param sourceNode The product node whose property has changed * @param propertyName The name of the property that was changed. * @param oldValue The old value. * @param newValue The new value. */ public ProductNodeEvent(final ProductNode sourceNode, final String propertyName, final Object oldValue, final Object newValue) { super(sourceNode); Guardian.assertNotNull("propertyName", propertyName); this.nodeGroup = getNodeGroup(sourceNode, null); this.propertyName = propertyName; this.type = NODE_CHANGED; this.oldValue = oldValue; this.newValue = newValue; }