public class FixedAmountOffPriceAdjustment extends FixedAmountOffAdjustment
FixedAmountOffPriceAdjustment
offers a discount of a fixed
amount 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 FixedAmountOffPriceAdjustment:
<Adjustment impl= "com.ibm.commerce.marketing.promotion.reward.FixedAmountOffPriceAdjustment"> <!-- Possible values are: -1: Standard offer price -2: Contract price -3: Discounted price --> <PriceAdjustmentBase>-1</PriceAdjustmentBase> <AmountOff>15</AmountOff> <Currency>CAD</Currency> <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 |
---|
FixedAmountOffPriceAdjustment()
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 an Integer representing the adjustment type of IndividualAffectedItems.
|
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, getAmountOff, getCurrency, getTheTypeOfMonetaryValueToBeAdjusted, setAmountOff, setCurrency
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 FixedAmountOffPriceAdjustment()
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 FixedAmountOffAdjustment
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 FixedAmountOffAdjustment
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 FixedAmountOffAdjustment
Adjustment.setAdjustmentType(java.lang.Integer)
public java.lang.Object clone()
CloneNotSupportedException
is thrown.clone
in interface Adjustment
clone
in class FixedAmountOffAdjustment
Object.clone()
public java.lang.String toXML() throws XMLizationException
XMLizable
toXML
in interface XMLizable
toXML
in class FixedAmountOffAdjustment
XMLizationException
- when this process failsXMLizable.toXML()
public void fromXML(org.w3c.dom.Node anXMLNode) throws DeXMLizationException
XMLizable
fromXML
in interface XMLizable
fromXML
in class FixedAmountOffAdjustment
anXMLNode
- The node that represents an XMLizable objectDeXMLizationException
- when this process failsXMLizable.fromXML(Node)
public int getPriceAdjustmentBasis()
public void setPriceAdjustmentBasis(int i)
i
- new basis for price adjustment.