com.ibm.commerce.marketing.promotion.condition

Class TotalCostFilter

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


    public class TotalCostFilter
    extends java.lang.Object
    implements Filter
    TotalCostFilter class filters LineItemSet based on the total cost of the items in the LineItemSet. It returns all the LineItems if their combined price is equal to or more than the price specified in the Filter. This class implements Filter interface.
     <Filter impl="com.ibm.commerce.marketing.promotion.condition.TotalCostFilter">
                    <TotalCost>200</TotalCost>
                    <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
      TotalCostFilter()
      Constructor for TotalCostFilter.
    • 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 getTotalCost()
      This method gets the TotalCost.
      void setCurrency(java.lang.String theCurrency)
      This method sets the currency
      void setTotalCost(java.math.BigDecimal theCost)
      This method sets the TotalCost.
      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

      • TotalCostFilter

        public TotalCostFilter()
        Constructor for TotalCostFilter.
    • Method Detail

      • getCurrency

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

        public java.math.BigDecimal getTotalCost()
        This method gets the TotalCost.
        Returns:
        java.math.BigDecimal TotalCost
      • setCurrency

        public void setCurrency(java.lang.String theCurrency)
        This method sets the currency
        Parameters:
        aCurrency - A currency string.
      • setTotalCost

        public void setTotalCost(java.math.BigDecimal theCost)
        This method sets the TotalCost.
        Parameters:
        _cost - java.math.BigDecimal
      • 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)