public class FixedCostAdjustment extends java.lang.Object implements MonetaryAdjustment
If the AdjustmentComparison flag exist in the XML and the value is 1, then it compares the fixed price with the current price and returns the lowest one, otherwise it returns the fixed price.
<Adjustment impl="com.ibm.commerce.marketing.promotion.reward.FixedCostAdjustment"> <FixedCost>45</FixedCost> <Currency>CAD</Currency> <!-- AllAffectedItems or IndividualAffectedItems --> <AdjustmentType>IndividualAffectedItems</AdjustmentType> <!-- 0 or 1 --> <AdjustmentComparison>0</AdjustmentComparison> </Adjustment>
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
FixedCostAdjustment()
Constructor for FixedCostAdjustment.
|
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 | getAdjustmentComparison()
Returns the adjustment comparison flag.
|
java.lang.Integer | getAdjustmentType()
This method gets the type of Adjustment.
|
java.lang.String | getCurrency()
This method gets the Currency.
|
java.math.BigDecimal | getFixedCost()
This method gets the Fixed Cost of the affected line items.
|
java.math.BigDecimal | getPerUnitAdjustment(AssociatedOrderItem one, AssociatedOrderItem[] all, PromotionContext context)
This method returns the monetary adjustment that needs to be applied to each unit.
|
int | getPriceAdjustmentBase()
Returns the price adjustment base.
|
int | getTheTypeOfMonetaryValueToBeAdjusted()
Returns the value of PRICE=1
|
void | setAdjustmentComparison(java.lang.Integer isCompared)
Sets the adjustment comparison flag.
|
void | setAdjustmentType(java.lang.Integer aAdjustmentType)
This method sets the type of Adjustment.
|
void | setCurrency(java.lang.String newCurrency)
This method sets the Currency.
|
void | setFixedCost(java.math.BigDecimal newFixedCost)
This method sets the Fixed Cost of the affected line items.
|
void | setPriceAdjustmentBase(int i)
Sets the price adjustment base.
|
java.lang.String | toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public FixedCostAdjustment()
public java.math.BigDecimal getFixedCost()
public java.lang.String getCurrency()
public void setFixedCost(java.math.BigDecimal newFixedCost)
public void setCurrency(java.lang.String newCurrency)
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 int getTheTypeOfMonetaryValueToBeAdjusted()
public java.math.BigDecimal getPerUnitAdjustment(AssociatedOrderItem one, AssociatedOrderItem[] all, PromotionContext context)
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 getPriceAdjustmentBase()
public void setPriceAdjustmentBase(int i)
public void setAdjustmentComparison(java.lang.Integer isCompared)
public java.lang.Integer getAdjustmentComparison()