public class PercentOffPriceAdjustment extends PercentOffAdjustment
PercentOffPriceAdjustment
offers a percentage discount off the
price of an order item. It is an adjustment on the price of
individual order items and the AdjustmentType is set to
IndividualAffectedItems.
XML Snippet for this type of Adjustment
:
<Adjustment impl="com.ibm.commerce.marketing.promotion.reward.PercentOffPriceAdjustment"> <!-- -1 for Standard Offer Price, -2 for Contract Price, -3 for Discounted Price --> <PriceAdjustmentBase>-3</PriceAdjustmentBase> <Percentage>15</Percentage> <AdjustmentType>IndividualAffectedItems</AdjustmentType> </Adjustment>
Modifier and Type | Field and Description |
---|---|
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.
|
static int |
STANDARD_OFFER_PRICE
The basis for price adjustment.
|
MAX_SCALE_FOR_DIVIDE, PRICE, SHIPPING, SHIPPING_TAX, TAX, ZERO
ALL_AFFECTED_ITEMS, INDIVIDUAL_AFFECTED_ITEMS, WHOLE_ORDER
Constructor and Description |
---|
PercentOffPriceAdjustment()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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()
Returns the adjustment type Individual Affected Items with value 3.
|
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()
Returns the basis for price adjustment.
|
void |
setAdjustmentType(java.lang.Integer adjustmentType)
This method sets the type of Adjustment.
|
void |
setPriceAdjustmentBasis(int i)
Sets the basis for price adjustment.
|
java.lang.String |
toXML()
Converts the object into its corresponding XML format representation.
|
apply, getCurrency, getMaxAmount, getPercent, getTheTypeOfMonetaryValueToBeAdjusted, setCurrency, setMaxAmount, setPercent
public static final java.lang.String COPYRIGHT
public static final int STANDARD_OFFER_PRICE
public static final int CONTRACT_PRICE
public static final int DISCOUNTED_PRICE
public java.math.BigDecimal getPerUnitAdjustment(AssociatedOrderItem one, AssociatedOrderItem[] all, PromotionContext context)
MonetaryAdjustment
AssociationOrderItem
). It is guaranteed that all units in
one
have been adjusted by exactly the same set of
monetary adjustments.getPerUnitAdjustment
in interface MonetaryAdjustment
getPerUnitAdjustment
in class PercentOffAdjustment
one
- the order item or portion of an order item for which a per unit adjustment
amount needs to be calculated.all
- all of the AssociatedOrderItems to which this adjustment applies.context
- PromotionContextMonetaryAdjustment.getPerUnitAdjustment(com.ibm.commerce.marketing.promotion.runtime.AssociatedOrderItem, com.ibm.commerce.marketing.promotion.runtime.AssociatedOrderItem[], com.ibm.commerce.marketing.promotion.runtime.PromotionContext)
public java.lang.Integer getAdjustmentType()
getAdjustmentType
in interface Adjustment
getAdjustmentType
in class PercentOffAdjustment
WHOLE_ORDER
, ALL_AFFECTED_ITEMS
or INDIVIDUAL_AFFECTED_ITEMS
.Adjustment.getAdjustmentType()
public void setAdjustmentType(java.lang.Integer adjustmentType)
Adjustment
WHOLE_ORDER
, ALL_AFFECTED_ITEMS
or INDIVIDUAL_AFFECTED_ITEMS
.setAdjustmentType
in interface Adjustment
setAdjustmentType
in class PercentOffAdjustment
Adjustment.setAdjustmentType(java.lang.Integer)
public java.lang.Object clone()
PercentOffAdjustment
CloneNotSupportedException
is thrown.clone
in interface Adjustment
clone
in class PercentOffAdjustment
Object.clone()
public java.lang.String toXML() throws XMLizationException
XMLizable
toXML
in interface XMLizable
toXML
in class PercentOffAdjustment
XMLizationException
- when this process failsXMLizable.toXML()
public void fromXML(org.w3c.dom.Node anXMLNode) throws DeXMLizationException
XMLizable
fromXML
in interface XMLizable
fromXML
in class PercentOffAdjustment
anXMLNode
- The node that represents an XMLizable objectDeXMLizationException
- when this process failsXMLizable.fromXML(Node)
public int getPriceAdjustmentBasis()
getPriceAdjustmentBasis
in class PercentOffAdjustment
public void setPriceAdjustmentBasis(int i)
setPriceAdjustmentBasis
in class PercentOffAdjustment
i
- new basis for price adjustment.