com.ibm.commerce.marketing.promotion.condition

Class CategoryFilter

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


    public class CategoryFilter
    extends java.lang.Object
    implements Filter
    CategoryFilter class filters LineItemSet based on the Categories to which the AssociatedOrderItem (of the LineItemSet) belong to. It returns all the AssociatedOrderItems which belong to categories in InclusionCategory list and doesn't belong to categories in ExclusionCategory list. This class implements Filter interface. XML snippet for this type of Filter.
     <Filter impl="com.ibm.commerce.marketing.promotion.condition.CategoryFilter">
            <IncludeCategory>
                    <CategoryKey>
                            <DN>Root Organization</DN>
                            <Name>Pants</Name>
                    </CategoryKey>
            </IncludeCategory>
            <ExcludeCategory>
                    <CategoryKey>
                            <DN>Root Organization</DN>
                            <Name>Sweaters</Name>
                    </CategoryKey>
            </ExcludeCategory>
     </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
      CategoryFilter()
      Constructor for CategoryFilter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addToExclusionList(CategoryKey key)
      This method adds the CategoryKey to the exclusion category list.
      void addToExclusionList(java.lang.String aDN, java.lang.String name)
      This method adds the CategoryKey identified by it's DN and Identifier to the Exclusion CategoryList.
      void addToInclusionList(CategoryKey key)
      This method adds the CategoryKey to the inclusion category list.
      void addToInclusionList(java.lang.String aDN, java.lang.String name)
      This method adds the CategoryKey identified by it's DN and Identifier, to the inclusion category list.
      boolean belongsToExclusionList(CategoryKey key)
      This method checks if CategoryKey belongs to the exclusion category list.
      boolean belongsToExclusionList(java.lang.String aDN, java.lang.String name)
      This method checks if CategoryKey identified by it's DN and identifier belongs to the exclusion category list.
      boolean belongsToInclusionList(CategoryKey key)
      This method checks if CategoryKey belongs to the inclusion category list.
      boolean belongsToInclusionList(java.lang.String aDN, java.lang.String name)
      This method checks if CategoryKey identified by it's DN and identifier belongs to the inclusion category list.
      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.
      CategoryKey[] getExclusionList()
      This method gets the list of CategoryKey in the exclusion category list.
      CategoryKey[] getInclusionList()
      This method gets the list of CategoryKey in the inclusion category list.
      void removeFromExclusionList(CategoryKey key)
      This method removes the CategoryKey from the exclusion category list.
      void removeFromExclusionList(java.lang.String aDN, java.lang.String name)
      This method removes the CategoryKey identified by it's DN and identifier from the exclusion category list.
      void removeFromInclusionList(CategoryKey key)
      This method removes the CategoryKey from the inclusion category list.
      void removeFromInclusionList(java.lang.String aDN, java.lang.String name)
      This method removes the CategoryKey identified by it's DN and identifier from the inclusion category list.
      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

      • CategoryFilter

        public CategoryFilter()
        Constructor for CategoryFilter.
    • Method Detail

      • getInclusionList

        public CategoryKey[] getInclusionList()
        This method gets the list of CategoryKey in the inclusion category list.
        Returns:
        list of CategoryKey
      • getExclusionList

        public CategoryKey[] getExclusionList()
        This method gets the list of CategoryKey in the exclusion category list.
        Returns:
        list of CategoryKey
      • addToInclusionList

        public void addToInclusionList(java.lang.String aDN,
                                       java.lang.String name)
        This method adds the CategoryKey identified by it's DN and Identifier, to the inclusion category list. This method is invoked in the fromXML(Node) method during transformation of the passed XML Node to the CategoryFilter object.
        Parameters:
        aDN - The DN of the category
        name - The Identifier of the category
      • addToInclusionList

        public void addToInclusionList(CategoryKey key)
        This method adds the CategoryKey to the inclusion category list. This method is invoked in the fromXML(Node) method during transformation of the passed XML Node to the CategoryFilter object.
        Parameters:
        key - CategoryKey
      • addToExclusionList

        public void addToExclusionList(java.lang.String aDN,
                                       java.lang.String name)
        This method adds the CategoryKey identified by it's DN and Identifier to the Exclusion CategoryList. This method is invoked in the fromXML(Node) method during transformation of the passed XML Node to the CategoryFilter object.
        Parameters:
        aDN - The DN of the category
        name - The identifier of the category
      • addToExclusionList

        public void addToExclusionList(CategoryKey key)
        This method adds the CategoryKey to the exclusion category list. This method is invoked in the fromXML(Node) method during transformation of the passed XML Node to the CategoryFilter object.
        Parameters:
        key - CategoryKey
      • removeFromExclusionList

        public void removeFromExclusionList(java.lang.String aDN,
                                            java.lang.String name)
        This method removes the CategoryKey identified by it's DN and identifier from the exclusion category list.
        Parameters:
        aDN - The DN of the category
        name - The identifier of the category
      • removeFromExclusionList

        public void removeFromExclusionList(CategoryKey key)
        This method removes the CategoryKey from the exclusion category list.
        Parameters:
        key - CategoryKey
      • removeFromInclusionList

        public void removeFromInclusionList(java.lang.String aDN,
                                            java.lang.String name)
        This method removes the CategoryKey identified by it's DN and identifier from the inclusion category list.
        Parameters:
        aDN - The DN of the category
        name - The identifier of the category
      • removeFromInclusionList

        public void removeFromInclusionList(CategoryKey key)
        This method removes the CategoryKey from the inclusion category list.
        Parameters:
        key - CategoryKey
      • belongsToInclusionList

        public boolean belongsToInclusionList(java.lang.String aDN,
                                              java.lang.String name)
        This method checks if CategoryKey identified by it's DN and identifier belongs to the inclusion category list.
        Parameters:
        aDN - The DN of the category
        name - The identifier of the category
        Returns:
        boolean true if belongs to inclusion list, false otherwise;
      • belongsToInclusionList

        public boolean belongsToInclusionList(CategoryKey key)
        This method checks if CategoryKey belongs to the inclusion category list.
        Parameters:
        key - CategoryKey
        Returns:
        boolean true if belongs to inclusion list, false otherwise;
      • belongsToExclusionList

        public boolean belongsToExclusionList(java.lang.String aDN,
                                              java.lang.String name)
        This method checks if CategoryKey identified by it's DN and identifier belongs to the exclusion category list.
        Parameters:
        aDN - The DN of the category
        name - The identifier of the category
        Returns:
        boolean true if belongs to exclusion list, false otherwise;
      • belongsToExclusionList

        public boolean belongsToExclusionList(CategoryKey key)
        This method checks if CategoryKey belongs to the exclusion category list.
        Parameters:
        key - CategoryKey
        Returns:
        boolean true if belongs to exclusion list, 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)