com.ibm.commerce.marketing.promotion.condition

Class PriceThresholdFilter

  • java.lang.Object
    • com.ibm.commerce.marketing.promotion.condition.PriceThresholdFilter
  • All Implemented Interfaces:
    Filter, XMLizable, java.io.Serializable


    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>
            
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Constructor Summary

      Constructors 
      Constructor and Description
      PriceThresholdFilter()
      Constructor for PriceThresholdFilter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PriceThresholdFilter

        public PriceThresholdFilter()
        Constructor for PriceThresholdFilter.
    • Method Detail

      • getCurrency

        public java.lang.String getCurrency()
        This method gets the Currency.
        Returns:
        java.lang.String Currency.
      • getThresholdPrice

        public java.math.BigDecimal getThresholdPrice()
        This method gets the ThresholdPrice.
        Returns:
        java.math.BigDecimal Threshold Price.
      • setCurrency

        public void setCurrency(java.lang.String _currency)
        This method sets the Currency.
        Parameters:
        _currency - java.lang.String.
      • setThresholdPrice

        public void setThresholdPrice(java.math.BigDecimal price)
        This method sets the ThresholdPrice.
        Parameters:
        price - java.math.BigDecimal.
      • isOfHigherPrice

        public boolean isOfHigherPrice(java.math.BigDecimal price)
        This method checks if Price of LineItem is greater than Threshold Price.
        Parameters:
        price - The price of line item.
        Returns:
        boolean true if price is higher; false otherwise
      • filter

        public LineItemSet filter(LineItemSet input,
                                  PromotionContext context)
        Description copied from interface: Filter
        This method performs the business logic to filter the input LineItemSet and return a subset of the original LineItemSet. An empty LineItemSet may be returned if no line item matches the filtering condition.
        Specified by:
        filter in interface Filter
        Parameters:
        input - LineItemSet
        context - PromotionContext
        Returns:
        the filtered LineItemSet
        See Also:
        Filter.filter(LineItemSet, PromotionContext)