public class PurchaseCondition extends java.lang.Object implements Condition
Pattern
and a Distribution
. The Purchase
Condition is a Condition, that is, it implements the Condition
interface.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
PurchaseCondition() |
Modifier and Type | Method and Description |
---|---|
boolean |
evaluate(PromotionContext context)
The evaluate method is used to determine if the condition has been
satisfied successfully.
|
void |
fromXML(org.w3c.dom.Node anXMLNode)
Transforms the XML node into its corresponding real Object.
|
com.ibm.commerce.marketing.promotion.reward.GenericDistribution |
getDistribution()
Returns the Distribution of this purchase condition
|
com.ibm.commerce.marketing.promotion.condition.GenericPattern |
getPattern()
Returns the Pattern of this purchase condition
|
void |
setDistribution(com.ibm.commerce.marketing.promotion.reward.GenericDistribution aDistribution)
Sets the Distribution of this purchase condition
|
void |
setPattern(com.ibm.commerce.marketing.promotion.condition.GenericPattern aPattern)
Sets the Pattern object of this purchase condition
|
java.lang.String |
toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public boolean evaluate(PromotionContext context) throws PromotionConditionEvaluationException
Condition
evaluate
in interface Condition
context
- The PromotionContext.PromotionConditionEvaluationException
- This exception is thrown if the evaluation encounters
unexpected problems.com.ibm.commerce.marketing.promotion.condition.Condition#evaluate(PromotionContext, PromotionExecutionRecord)
public java.lang.String toXML() throws XMLizationException
XMLizable
toXML
in interface XMLizable
XMLizationException
- when this process failsXMLizable.toXML()
public void fromXML(org.w3c.dom.Node anXMLNode) throws DeXMLizationException
XMLizable
fromXML
in interface XMLizable
anXMLNode
- The node that represents an XMLizable objectDeXMLizationException
- when this process failsXMLizable.fromXML(Node)
public com.ibm.commerce.marketing.promotion.reward.GenericDistribution getDistribution()
public com.ibm.commerce.marketing.promotion.condition.GenericPattern getPattern()
public void setDistribution(com.ibm.commerce.marketing.promotion.reward.GenericDistribution aDistribution)
aDistribution
- The Distribution object to setpublic void setPattern(com.ibm.commerce.marketing.promotion.condition.GenericPattern aPattern)
aPattern
- The pattern object to set