public class DefaultChoiceOfFreeGiftAdjustment extends java.lang.Object implements ChoiceOfFreeGiftAdjustment
<p> <Adjustment impl="com.ibm.commerce.marketing.promotion.reward.DefaultChoiceOfFreeGiftAdjustment"> <RewardSpecification impl="com.ibm.commerce.marketing.promotion.choice.gift.FreeGiftSpecification"> <MaxQuantity>3</MaxQuantity> <GiftItem impl="com.ibm.commerce.marketing.promotion.choice.gift.CatalogEntryGiftItem"> <Quantity>3</Quantity> <CatalogEntryKey> <SKU>SKU-20101099</SKU> <DN>o=Root Organization</DN> </CatalogEntryKey> </GiftItem> </RewardSpecification> <RewardChoice impl="com.ibm.commerce.marketing.promotion.choice.gift.FreeGiftChoice"> <GiftItem impl="com.ibm.commerce.marketing.promotion.choice.gift.CatalogEntryGiftItem"> <Quantity>1</Quantity> <CatalogEntryKey> <SKU>SKU-20101099</SKU> <DN>o=Root Organization</DN> </CatalogEntryKey> </GiftItem> </RewardChoice> <AdjustmentType>AllAffectedItems</AdjustmentType> </Adjustment> </p>
Modifier and Type | Field and Description |
---|---|
static java.lang.String | ATTRIBUTE_NAME_IMPL
XML attribute name - impl
|
static java.lang.String | COPYRIGHT
IBM Copyright notice field.
|
static java.lang.String | TAG_ADJUSTMENT
XML tag - Adjustment
|
static java.lang.String | TAG_ADJUSTMENT_TYPE
XML Tag names
|
Constructor and Description |
---|
DefaultChoiceOfFreeGiftAdjustment() |
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).
|
boolean | applyChoice(FreeGiftChoice aFreeGiftChoice, java.util.Vector affectedVector, java.util.Vector adjustmentVector)
Applies the free gift choice to the promotion.
|
void | applyNewRewardOption(PromotionContext context)
Creates a new RewardOption object.
|
java.lang.Object | clone() |
void | fromXML(org.w3c.dom.Node anXMLNode)
Transforms the XML node into its corresponding real Object.
|
java.lang.Integer | getAdjustmentType()
This implementation always return value 2 as "AllAffectedItems".
|
RewardChoice | getDefaultRewardChoice()
Gets the optional default reward choice.
|
RewardSpecification | getRewardSpecification()
Gets the RewardSpecification object.
|
void | setAdjustmentType(java.lang.Integer aAdjustmentType)
This method sets the type of Adjustment.
|
void | setFreeGiftChoice(FreeGiftChoice aFreeGiftChoice)
Sets the FreeGiftChoice object as the default RewardChoice.
|
void | setRewardSpecification(FreeGiftSpecification aFreeGiftSpecification)
Sets the FreeGiftSpecification object.
|
java.lang.String | toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public static final java.lang.String TAG_ADJUSTMENT_TYPE
public static final java.lang.String TAG_ADJUSTMENT
public static final java.lang.String ATTRIBUTE_NAME_IMPL
public void applyNewRewardOption(PromotionContext context)
public boolean applyChoice(FreeGiftChoice aFreeGiftChoice, java.util.Vector affectedVector, java.util.Vector adjustmentVector)
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 java.lang.Integer getAdjustmentType()
public void setAdjustmentType(java.lang.Integer aAdjustmentType)
public void fromXML(org.w3c.dom.Node anXMLNode) throws DeXMLizationException
public java.lang.String toXML() throws XMLizationException
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
public RewardSpecification getRewardSpecification()
public void setRewardSpecification(FreeGiftSpecification aFreeGiftSpecification)
public RewardChoice getDefaultRewardChoice()
public void setFreeGiftChoice(FreeGiftChoice aFreeGiftChoice)