Enum Class DiscountMethodType

java.lang.Object
java.lang.Enum<DiscountMethodType>
com.broadleafcommerce.promotion.offer.domain.type.DiscountMethodType
All Implemented Interfaces:
Serializable, Comparable<DiscountMethodType>, Constable

public enum DiscountMethodType extends Enum<DiscountMethodType>
Enumerates the methods whereby to apply an offer's discount to a target.
Author:
Chad Harchar (charchar)
  • Enum Constant Details

    • PERCENT_OFF

      public static final DiscountMethodType PERCENT_OFF
      Take a percent off the total amount. For example, an offer using this discount method with a discount value of .20 being applied to an item with a price of $5, would result in a new price of $5 - ($5 * .20) = $4.
    • AMOUNT_OFF

      public static final DiscountMethodType AMOUNT_OFF
      Take an amount off of the total amount. For example, an offer using this discount method with a discount value of 1 being applied to an item with a price of $5, would result in a new price of $5 - $1 = $4.
    • FIXED_PRICE

      public static final DiscountMethodType FIXED_PRICE
      Replace the amount with a fixed price. For example, an offer using this discount method with a discount value of 4 being applied to an item with a price of $5, would result in a new price of $4. Only items can have fixed price discounts—orders cannot.
  • Method Details

    • values

      public static DiscountMethodType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DiscountMethodType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isPercentOff

      public static boolean isPercentOff(String methodType)
    • isAmountOff

      public static boolean isAmountOff(String methodType)
    • isFixedPrice

      public static boolean isFixedPrice(String methodType)