com.ibm.commerce.marketing.promotion.condition

Class PurchaseCondition

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


    public class PurchaseCondition
    extends java.lang.Object
    implements Condition
    Purchase condition specifies the purchases a shopper has to make before the shopper can qualify for a promotion. A Purchase Condition attempts to spot patterns and attaches Adjustments to matched patterns. A Purchase Condition contains a Pattern and a Distribution. The Purchase Condition is a Condition, that is, it implements the Condition interface.
    See Also:
    Serialized Form
    • Field Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean evaluate(PromotionContext context)
      The evaluate method is used to determine if the condition has been satisfied successfully.
      void fromXML(org.w3c.dom.Node anXMLNode)
      Transforms the XML node into its corresponding real Object.
      com.ibm.commerce.marketing.promotion.reward.GenericDistribution getDistribution()
      Returns the Distribution of this purchase condition
      com.ibm.commerce.marketing.promotion.condition.GenericPattern getPattern()
      Returns the Pattern of this purchase condition
      void setDistribution(com.ibm.commerce.marketing.promotion.reward.GenericDistribution aDistribution)
      Sets the Distribution of this purchase condition
      void setPattern(com.ibm.commerce.marketing.promotion.condition.GenericPattern aPattern)
      Sets the Pattern object of this purchase condition
      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

      • PurchaseCondition

        public PurchaseCondition()
    • Method Detail

      • evaluate

        public boolean evaluate(PromotionContext context)
                         throws PromotionConditionEvaluationException
        Description copied from interface: Condition
        The evaluate method is used to determine if the condition has been satisfied successfully. If true is returned, the condition is considered satisfied. If false, the condition is considered not satisfied.
        Specified by:
        evaluate in interface Condition
        Parameters:
        context - The PromotionContext.
        Returns:
        true if the condition has been satisfied successfully. Returns false otherwise.
        Throws:
        PromotionConditionEvaluationException - This exception is thrown if the evaluation encounters unexpected problems.
        See Also:
        com.ibm.commerce.marketing.promotion.condition.Condition#evaluate(PromotionContext, PromotionExecutionRecord)
      • getDistribution

        public com.ibm.commerce.marketing.promotion.reward.GenericDistribution getDistribution()
        Returns the Distribution of this purchase condition
        Returns:
        a GenericDistribution object
      • getPattern

        public com.ibm.commerce.marketing.promotion.condition.GenericPattern getPattern()
        Returns the Pattern of this purchase condition
        Returns:
        the GenericPattern object of this purchase condition
      • setDistribution

        public void setDistribution(com.ibm.commerce.marketing.promotion.reward.GenericDistribution aDistribution)
        Sets the Distribution of this purchase condition
        Parameters:
        aDistribution - The Distribution object to set
      • setPattern

        public void setPattern(com.ibm.commerce.marketing.promotion.condition.GenericPattern aPattern)
        Sets the Pattern object of this purchase condition
        Parameters:
        aPattern - The pattern object to set