com.ibm.commerce.marketing.promotion.reward

Interface Adjustment

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.Integer ALL_AFFECTED_ITEMS
      Indicates all Affected Items.
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
      static java.lang.Integer INDIVIDUAL_AFFECTED_ITEMS
      Indicates Individual Affected Items.
      static java.lang.Integer WHOLE_ORDER
      Indicates Whole Order.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      boolean apply(LineItemSet targeted, java.math.BigDecimal targetedAmount, int targetedAmountTypes, LineItemSet affected, java.util.Vector affectedVector, java.util.Vector adjustmentVector, PromotionContext context)
      This method evaluates the targeted order items to see if they fulfill the conditions of this adjustment ( for example, if the quantity of the order items falls into one of the ranges of the adjustment).
      java.lang.Object clone() 
      java.lang.Integer getAdjustmentType()
      This method gets the type of Adjustment.
      void setAdjustmentType(java.lang.Integer adjustmentType)
      This method sets the type of Adjustment.
    • Field Detail

      • COPYRIGHT

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

        static final java.lang.Integer WHOLE_ORDER
        Indicates Whole Order.
      • ALL_AFFECTED_ITEMS

        static final java.lang.Integer ALL_AFFECTED_ITEMS
        Indicates all Affected Items.
      • INDIVIDUAL_AFFECTED_ITEMS

        static final java.lang.Integer INDIVIDUAL_AFFECTED_ITEMS
        Indicates Individual Affected Items.
    • Method Detail

      • getAdjustmentType

        java.lang.Integer getAdjustmentType()
        This method gets the type of Adjustment. An adjustment can be of the following types: for the whole Order, for All the Affected Items, or for Individual Affected Items.
        Returns:
        one of the defined constants of WHOLE_ORDER, ALL_AFFECTED_ITEMS or INDIVIDUAL_AFFECTED_ITEMS.
      • setAdjustmentType

        void setAdjustmentType(java.lang.Integer adjustmentType)
        This method sets the type of Adjustment. An adjustment can be of the following types for whole Order, for All Affected Items, and for Individual Affected Items. Set adjustmentType to one of the defined constants of WHOLE_ORDER, ALL_AFFECTED_ITEMS or INDIVIDUAL_AFFECTED_ITEMS.
      • apply

        boolean apply(LineItemSet targeted,
                      java.math.BigDecimal targetedAmount,
                      int targetedAmountTypes,
                      LineItemSet affected,
                      java.util.Vector affectedVector,
                      java.util.Vector adjustmentVector,
                      PromotionContext context)
               throws PromotionRuntimeException
        This method evaluates the targeted order items to see if they fulfill the conditions of this adjustment ( for example, if the quantity of the order items falls into one of the ranges of the adjustment). Depending upon if and what conditions are fulfilled, an Adjustment object is added to the adjustmentVector Vector object passed as a parameter. The affectedVector Vector object passed as a parameter is updated by adding the affected order items. This method is called in the invoke(LineItemSet, BigDecimal, int, Vector, Vector, PromotionContext) method of AdjustmentFunction.
        Parameters:
        targeted - The targeted order items. This is a set of order items (or portions of order items) that are used to qualify for the promotion of which this adjustment is a part.
        affected - The affected order items. This is a set of order items, identified by the promotion, to which this adjustment will be attached.
        affectedVector - A Vector which contains the affected LineItemSets.
        adjustmentVector - A Vector which contains the Adjustment objects.
        context - The PromotionContext object which may be used to build the Adjustment to add to the adjustmentVector parameter.
        Returns:
        A boolean value indicating whether the conditions of the adjustment were fulfilled successfully or not. A true value indicates that the conditions of the adjustment were fulfilled successully, otherwise a false value is returned.
        Throws:
        PromotionRuntimeException - when the computation encounters a problem.
      • clone

        java.lang.Object clone()
                        throws java.lang.CloneNotSupportedException
        Throws:
        java.lang.CloneNotSupportedException
        See Also:
        Object.clone()