public class PercentOffAdjustment extends java.lang.Object implements MonetaryAdjustment
<p> <Adjustment impl="com.ibm.commerce.marketing.promotion.reward.PercentOffAdjustment"> <Percentage>15</Percentage> <!-- wholeOrder or AllAffectedItems or IndividualAffectedItems --> <AdjustmentType>wholeOrder</AdjustmentType> <!-- Max Amount is the cap (optional) --> <MaxAmount>20</MaxAmount> <!-- If the above Max Amount is provided, the following should be provided too --> <Currency>USD</Currency> <!-- -1 for Standard Offer Price, -2 for Contract Price, -3 for Discounted Price --> <PriceAdjustmentBase>-3</PriceAdjustmentBase> </Adjustment> </p>
Modifier and Type | Field and Description |
---|---|
protected static java.math.BigDecimal | AMOUNT_ZERO
BigDecimal of zero
|
static int | CONTRACT_PRICE
The basis for price adjustment.
|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
static int | DISCOUNTED_PRICE
The basis for price adjustment.
|
protected static int | INIT_PRICE_ADJ_BASE
The basis for price adjustment initial value.
|
protected static double | ONE_HUNDRED
The number 100.
|
static int | STANDARD_OFFER_PRICE
The basis for price adjustment.
|
protected static java.lang.String | TAG_ADJUSTMENT
XML Tag names
|
protected static java.lang.String | TAG_ADJUSTMENT_TYPE
XML Tag names
|
protected static java.lang.String | TAG_CURRENCY
XML Tag names
|
protected static java.lang.String | TAG_MAX_AMOUNT
XML Tag names
|
protected static java.lang.String | TAG_PERCENTAGE
XML Tag names
|
protected static java.lang.String | TAG_PRICE_ADJUSTMENT_BASE
XML Tag names
|
Constructor and Description |
---|
PercentOffAdjustment()
Constructor for PercentOffAdjustment.
|
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.
|
java.lang.String | getCurrency()
This method gets the currency.
|
java.math.BigDecimal | getMaxAmount()
This method gets a maximum amount as the discount.
|
java.math.BigDecimal | getPercent()
This method gets the percent to be given as discount.
|
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 | getPriceAdjustmentBasis()
This method gets the price adjustment base.
|
int | getTheTypeOfMonetaryValueToBeAdjusted()
Returns the target of a monetary adjustment.
|
void | setAdjustmentType(java.lang.Integer _adjustmentType)
This method sets the type of Adjustment.
|
void | setCurrency(java.lang.String currency)
This method sets the currency.
|
void | setMaxAmount(java.math.BigDecimal newMaxAmount)
This method sets the maximum amount to be given as the discount.
|
void | setPercent(java.math.BigDecimal newPercent)
This method sets the percent to be given as discount.
|
void | setPriceAdjustmentBasis(int priceAdjustmentBasis)
This method 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
protected static final java.lang.String TAG_ADJUSTMENT
protected static final java.lang.String TAG_PERCENTAGE
protected static final java.lang.String TAG_ADJUSTMENT_TYPE
protected static final java.lang.String TAG_MAX_AMOUNT
protected static final java.lang.String TAG_CURRENCY
protected static final java.lang.String TAG_PRICE_ADJUSTMENT_BASE
protected static final java.math.BigDecimal AMOUNT_ZERO
public static final int STANDARD_OFFER_PRICE
public static final int CONTRACT_PRICE
public static final int DISCOUNTED_PRICE
protected static final double ONE_HUNDRED
protected static final int INIT_PRICE_ADJ_BASE
public PercentOffAdjustment()
public java.math.BigDecimal getMaxAmount()
public void setMaxAmount(java.math.BigDecimal newMaxAmount)
public java.math.BigDecimal getPercent()
public void setPercent(java.math.BigDecimal newPercent)
public java.lang.Integer getAdjustmentType()
public void setAdjustmentType(java.lang.Integer _adjustmentType)
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 java.lang.String getCurrency()
public void setCurrency(java.lang.String currency)
public int getPriceAdjustmentBasis()
public void setPriceAdjustmentBasis(int priceAdjustmentBasis)