Enum Class DiscountMethodType
java.lang.Object
java.lang.Enum<DiscountMethodType>
com.broadleafcommerce.promotion.offer.domain.type.DiscountMethodType
- All Implemented Interfaces:
Serializable
,Comparable<DiscountMethodType>
,Constable
Enumerates the methods whereby to apply an
offer's discount
to a target.- Author:
- Chad Harchar (charchar)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionTake an amount off of the total amount.Replace the amount with a fixed price.Take a percent off the total amount. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isAmountOff
(String methodType) static boolean
isFixedPrice
(String methodType) static boolean
isPercentOff
(String methodType) static DiscountMethodType
Returns the enum constant of this class with the specified name.static DiscountMethodType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
Take an amount off of the total amount. For example, an offer using this discount method with a discount value of1
being applied to an item with a price of$5
, would result in a new price of$5 - $1 = $4
. -
FIXED_PRICE
Replace the amount with a fixed price. For example, an offer using this discount method with a discount value of4
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
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
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 nameNullPointerException
- if the argument is null
-
isPercentOff
-
isAmountOff
-
isFixedPrice
-