public class VoucherAdjustment extends java.lang.Object implements Adjustment
VoucherAdjustment offers a coupon that can be used towards a
future purchase. It provides implementation for Voucher type of adjustment.
This class implements Adjustment interface. XML Snippet for
this type of Adjustment:
<Adjustment impl="com.ibm.commerce.marketing.promotion.reward.VoucherAdjustment">
<PromotionKey>
<StoreKey>
<DN>Root Organization</DN>
<Identifier>Store 201</Identifier>
</StoreKey>
<PromotionName>20% Off Any Purchase</PromotionName>
<Version>2</Version>
<Revision>1</Revision>
</PromotionKey>
<!-- wholeOrder or AllAffectedItems or IndividualAffectedItems -->
<AdjustmentType>wholeOrder</AdjustmentType>
</Adjustment>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
ALL_AFFECTED_ITEMS, INDIVIDUAL_AFFECTED_ITEMS, WHOLE_ORDER| Constructor and Description |
|---|
VoucherAdjustment()
Constructor for VoucherAdjustment.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
apply(LineItemSet targeted,
java.math.BigDecimal targetedAmount,
int targetedAmountTypes,
LineItemSet affected,
java.util.Vector affectedVector,
java.util.Vector adjustmentVector,
PromotionContext context)
This method evaluates the targeted order items to see if they fulfill the
conditions of this adjustment ( for example, if the quantity of the order
items falls into one of the ranges of the adjustment).
|
java.lang.Object |
clone()
Returns null if the
CloneNotSupportedException is thrown. |
void |
fromXML(org.w3c.dom.Node anXMLNode)
Transforms the XML node into its corresponding real Object.
|
java.lang.Integer |
getAdjustmentType()
This method gets the type of Adjustment.
|
PromotionKey |
getPromotionKey()
This method gets the
PromotionKey. |
void |
setAdjustmentType(java.lang.Integer _adjustmentType)
This method sets the type of Adjustment.
|
void |
setPromotionKey(PromotionKey _promotionKey)
This method sets the
PromotionKey. |
java.lang.String |
toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public PromotionKey getPromotionKey()
PromotionKey.PromotionKey promotion keypublic void setPromotionKey(PromotionKey _promotionKey)
PromotionKey._promotionKey - PromotionKey promotion keypublic java.lang.Integer getAdjustmentType()
AdjustmentgetAdjustmentType in interface AdjustmentWHOLE_ORDER, ALL_AFFECTED_ITEMS or INDIVIDUAL_AFFECTED_ITEMS.Adjustment.getAdjustmentType()public void setAdjustmentType(java.lang.Integer _adjustmentType)
AdjustmentWHOLE_ORDER, ALL_AFFECTED_ITEMS or INDIVIDUAL_AFFECTED_ITEMS.setAdjustmentType in interface AdjustmentAdjustment.setAdjustmentType(Integer)public java.lang.String toXML()
throws XMLizationException
XMLizabletoXML in interface XMLizableXMLizationException - when this process failsXMLizable.toXML()public void fromXML(org.w3c.dom.Node anXMLNode)
throws DeXMLizationException
XMLizablefromXML in interface XMLizableanXMLNode - The node that represents an XMLizable objectDeXMLizationException - when this process failsXMLizable.fromXML(Node)public java.lang.Object clone()
CloneNotSupportedException is thrown.clone in interface Adjustmentclone in class java.lang.ObjectObject.clone()public boolean apply(LineItemSet targeted, java.math.BigDecimal targetedAmount, int targetedAmountTypes, LineItemSet affected, java.util.Vector affectedVector, java.util.Vector adjustmentVector, PromotionContext context) throws PromotionRuntimeException
AdjustmentadjustmentVector Vector object passed as a parameter. The
affectedVector Vector object passed as a parameter is
updated by adding the affected order items. This method is called in the
invoke(LineItemSet, BigDecimal, int, Vector, Vector, PromotionContext)
method of AdjustmentFunction.apply in interface Adjustmenttargeted - The targeted order items. This is a set of order items (or
portions of order items) that are used to qualify for the
promotion of which this adjustment is a part.affected - The affected order items. This is a set of order items,
identified by the promotion, to which this adjustment will be
attached.affectedVector - A Vector which contains the affected LineItemSets.adjustmentVector - A Vector which contains the Adjustment objects.context - The PromotionContext object which may be used to build
the Adjustment to add to the adjustmentVector parameter.PromotionRuntimeException - when the computation encounters a problem.com.ibm.commerce.marketing.promotion.reward.Adjustment#apply(com.ibm.commerce.marketing.promotion.runtime.LineItemSet, com.ibm.commerce.marketing.promotion.runtime.LineItemSet, com.ibm.commerce.marketing.promotion.runtime.PromotionContext)