com.ibm.commerce.discount.rules

Class Discount

  • java.lang.Object
    • com.ibm.commerce.discount.rules.Discount
  • All Implemented Interfaces:
    DiscountConst


    public class Discount
    extends java.lang.Object
    implements DiscountConst
    This class represents a general discount type. See the methods for more details on the discount object.
    • Field Detail

      • COPYRIGHT

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

      • Discount

        public Discount()
        Constructor for Discount.
    • Method Detail

      • getDiscountCode

        public java.lang.String getDiscountCode()
        Get the discount code, which is unique within one store to represent a discount.
        Returns:
        java.lang.Integer
      • getDiscountLevel

        public java.lang.Integer getDiscountLevel()
        Get the discount level, which could be product level or order level based on the discount target.
        Returns:
        one of the constants of DiscountConst.PRODUCT_LEVEL or DiscountConst.ORDER_LEVEL.
      • getFixedPriceItems

        public FixedPriceItem[] getFixedPriceItems()
        Get the fixed price items associated with the discount. A fixed price item is an order item with a fixed price.
        Returns:
        an array of fixed price items.
      • getFreebieItems

        public FreebieItem[] getFreebieItems()
        Get the freebie items associated with the discount. A freebie item is an item given as free with a promotion.
        Returns:
        an array for freebie items.
      • getMixedDiscount

        public MixedDiscount getMixedDiscount()
        Get the mixed discount object.
        Returns:
        com.ibm.commerce.discount.rules.MixedDiscount
      • getMonetaryDiscount

        public MonetaryDiscount getMonetaryDiscount()
        Get the monetary discount object.
        Returns:
        com.ibm.commerce.discount.rules.MonetaryDiscount
      • getProfileNames

        public java.lang.String[] getProfileNames()
        Get the profile names.
        Returns:
        java.lang.String[]
      • getServiceDiscounts

        public ServiceDiscount[] getServiceDiscounts()
        Get the service discounts.
        Returns:
        com.ibm.commerce.discount.rules.ServiceDiscount[]
      • setDiscountCode

        public void setDiscountCode(java.lang.String newDiscountCode)
        Set the discount code.
        Parameters:
        newDiscountCode - java.lang.String
      • setDiscountLevel

        public void setDiscountLevel(java.lang.Integer newDiscountLevel)
        Set the discount level.
        Parameters:
        newLevel - java.lang.Integer
      • setFixedPriceItems

        public void setFixedPriceItems(FixedPriceItem[] newFixedPriceItems)
        Set the fixed price items.
        Parameters:
        newOrderItemFixedPrices - com.ibm.commerce.discount.rules.FixedPriceItem[]
      • setFreebieItems

        public void setFreebieItems(FreebieItem[] newFreebieItems)
        Set the freebie items.
        Parameters:
        newOrderItemFreebies - com.ibm.commerce.discount.rules.FreebieItem[]
      • setMixedDiscount

        public void setMixedDiscount(MixedDiscount newMixedDiscount)
        Set the mixed discount.
        Parameters:
        newOrderDiscounts - com.ibm.commerce.discount.rules.MixedDiscount
      • setMonetaryDiscount

        public void setMonetaryDiscount(MonetaryDiscount newMonetaryDiscount)
        Set the monetary discount.
        Parameters:
        newOrderItemDiscounts - com.ibm.commerce.discount.rules.MonetaryDiscount
      • setProfileNames

        public void setProfileNames(java.lang.String[] newProfileNames)
        Set the segment names.
        Parameters:
        newProfileNames - java.lang.String[]
      • setServiceDiscounts

        public void setServiceDiscounts(ServiceDiscount[] newServiceDiscounts)
        Set the service discounts.
        Parameters:
        newServiceDiscounts - com.ibm.commerce.discount.rules.ServiceDiscount[]