Enum DefaultOfferProrationType
- java.lang.Object
-
- java.lang.Enum<DefaultOfferProrationType>
-
- com.broadleafcommerce.order.common.domain.enums.DefaultOfferProrationType
-
- All Implemented Interfaces:
Serializable
,Comparable<DefaultOfferProrationType>
public enum DefaultOfferProrationType extends Enum<DefaultOfferProrationType>
Enumerates the default types of offer discount proration.This determines how an offer's discount should be distributed for refund, whether just "targets" or also "qualifiers".
- Author:
- Sunny Yu
-
-
Enum Constant Summary
Enum Constants Enum Constant Description TARGET_AND_QUALIFIER
The discount for an offer is distributed across targeted and qualifying items.TARGET_ONLY
The discount is only prorated/distributed to the targeted items of the offer.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isTargetAndQualifierProration(String prorationType)
static boolean
isTargetOnlyProration(String prorationType)
static DefaultOfferProrationType
valueOf(String name)
Returns the enum constant of this type with the specified name.static DefaultOfferProrationType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
TARGET_ONLY
public static final DefaultOfferProrationType TARGET_ONLY
The discount is only prorated/distributed to the targeted items of the offer.For example, let's say we have a buy 1x get 1y free offer, x is the qualifying item (qualifier) and y is the targeted item (target).
TARGET_ONLY
means that the discount is not distributed and is only on the target item.
-
TARGET_AND_QUALIFIER
public static final DefaultOfferProrationType TARGET_AND_QUALIFIER
The discount for an offer is distributed across targeted and qualifying items.For example, let's say we have a buy 1x get 1y free offer, x is the qualifying item (qualifier) and y is the targeted item (target).
TARGET_AND_QUALIFIER
means that the discount is distributed across target and qualifier items.
-
-
Method Detail
-
values
public static DefaultOfferProrationType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DefaultOfferProrationType c : DefaultOfferProrationType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DefaultOfferProrationType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
isTargetOnlyProration
public static boolean isTargetOnlyProration(String prorationType)
-
isTargetAndQualifierProration
public static boolean isTargetAndQualifierProration(String prorationType)
-
-