public class TotalCostPatternFilter extends java.lang.Object implements PatternFilter
TotalCostPatternFilter
class filters LineItemSet based on the Total Cost
of the items LineItemSet. If the total cost of all items exceeds the cost specified
in the Filter it returns true else it returns false.This class implements
PatternFilter
interface.
XML Snippet for this type of PatternFilter
.
<PatternFilter impl="com.ibm.commerce.marketing.promotion.condition.TotalCostPatternFilter"> <TotalCost>200</TotalCost> <Currency>CAD</Currency> </PatternFilter>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
TotalCostPatternFilter()
Constructor for TotalCostPatternFilter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
evaluate(LineItemSet input,
PromotionContext context)
This method checks if the
LineItemSet passed as input
satisfies the condition specified in the filter. |
void |
fromXML(org.w3c.dom.Node anXMLNode)
Transforms the XML node into its corresponding real Object.
|
java.lang.String |
getCurrency()
This method gets the Currency.
|
java.math.BigDecimal |
getTotalCost()
This method gets the TotalCost.
|
void |
setCurrency(java.lang.String _currency)
This method sets the currency
|
void |
setTotalCost(java.math.BigDecimal _cost)
This method sets the TotalCost.
|
java.lang.String |
toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public TotalCostPatternFilter()
public java.lang.String getCurrency()
public java.math.BigDecimal getTotalCost()
public void setCurrency(java.lang.String _currency)
_currency
- java.lang.Stringpublic void setTotalCost(java.math.BigDecimal _cost)
_cost
- java.math.BigDecimalpublic boolean evaluate(LineItemSet input, PromotionContext context)
PatternFilter
LineItemSet
passed as input
satisfies the condition specified in the filter.evaluate
in interface PatternFilter
input
- LineItemSet
context
- PromotionContext
true
if condition satisfied;
false
otherwisePatternFilter.evaluate(LineItemSet, PromotionContext)
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)