public class FreePurchasableGiftAdjustment extends java.lang.Object implements Adjustment
<Adjustment impl="com.ibm.commerce.marketing.promotion.reward.FreePurchasableGiftAdjustment"> <GiftItem> <CatalogEntryKey> <SKU>SKU-20101088</SKU> <DN>o=Root Organization</DN> </CatalogEntryKey> </GiftItem> <Quantity>2</Quantity> <AddStrategy>2</AddStrategy> <!-- wholeOrder or AllAffectedItems or IndividualAffectedItems --> <AdjustmentType>AllAffectedItems</AdjustmentType> </Adjustment>
Modifier and Type | Field and Description |
---|---|
static int | ADD_WHEN_NEEDED
Add free gift to the shop cart if shop cart does not contain one
|
static int | ALWAYS_ADD
Always add free gift to the shop cart
|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
static int | NEVER_ADD
Never add the free gift to the shop cart, free gift must already be present
|
Constructor and Description |
---|
FreePurchasableGiftAdjustment()
Constructor for FreePurchasableGiftAdjustment.
|
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.
|
int | getAddStrategy()
Gets add strategy.
|
java.lang.Integer | getAdjustmentType()
This method gets the type of Adjustment.
|
CatalogEntryKey | getFreeGift()
This method gets the Free Gift item.
|
java.lang.Integer | getNumOfGiftItems()
This method gets the quantity of Free Gift items to be given as discount.
|
void | setAddStrategy(int aAddStrategy)
Sets the add strategy.
|
void | setAdjustmentType(java.lang.Integer aAdjustmentType)
This method sets the type of Adjustment.
|
void | setFreeGift(CatalogEntryKey catEntry)
This method sets the Free Gift item.
|
void | setNumOfGiftItems(java.lang.Integer numOfItems)
This method sets the quantity of Free Gift items to be given as discount.
|
java.lang.String | toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public static final int ADD_WHEN_NEEDED
public static final int ALWAYS_ADD
public static final int NEVER_ADD
public FreePurchasableGiftAdjustment()
public CatalogEntryKey getFreeGift()
public java.lang.Integer getNumOfGiftItems()
public void setFreeGift(CatalogEntryKey catEntry)
public void setNumOfGiftItems(java.lang.Integer numOfItems)
public java.lang.Integer getAdjustmentType()
public void setAdjustmentType(java.lang.Integer aAdjustmentType)
public java.lang.String toXML() throws XMLizationException
public void fromXML(org.w3c.dom.Node anXMLNode) throws DeXMLizationException
public java.lang.Object 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
public int getAddStrategy()
public void setAddStrategy(int aAddStrategy)