public class PriceThresholdFilter extends java.lang.Object implements Filter
PriceThresholdFilter
class filters LineItemSet based on the Price
of the LineItems (of the LineItemSet). It returns all the LineItems whose Price
is equal to or more than the Price specified in the Filter. This class implements
Filter
interface.
XML Snippet for this type of Filter
.
<Filter impl="com.ibm.commerce.marketing.promotion.condition.PriceThresholdFilter"> <ThresholdPrice>200</ThresholdPrice> <Currency>CAD</Currency> </Filter>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
PriceThresholdFilter()
Constructor for PriceThresholdFilter.
|
Modifier and Type | Method and Description |
---|---|
LineItemSet |
filter(LineItemSet input,
PromotionContext context)
This method performs the business logic to filter the input LineItemSet
and return a subset of the original LineItemSet.
|
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 |
getThresholdPrice()
This method gets the ThresholdPrice.
|
boolean |
isOfHigherPrice(java.math.BigDecimal price)
This method checks if Price of LineItem is greater than Threshold Price.
|
void |
setCurrency(java.lang.String _currency)
This method sets the Currency.
|
void |
setThresholdPrice(java.math.BigDecimal price)
This method sets the ThresholdPrice.
|
java.lang.String |
toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public PriceThresholdFilter()
public java.lang.String getCurrency()
public java.math.BigDecimal getThresholdPrice()
public void setCurrency(java.lang.String _currency)
_currency
- java.lang.String.public void setThresholdPrice(java.math.BigDecimal price)
price
- java.math.BigDecimal.public boolean isOfHigherPrice(java.math.BigDecimal price)
price
- The price of line item.true
if price is higher;
false
otherwisepublic LineItemSet filter(LineItemSet input, PromotionContext context)
Filter
filter
in interface Filter
input
- LineItemSet
context
- PromotionContext
LineItemSet
Filter.filter(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)