Enum Class ItemRestrictionType
java.lang.Object
java.lang.Enum<ItemRestrictionType>
com.broadleafcommerce.promotion.offer.domain.type.ItemRestrictionType
- All Implemented Interfaces:
Serializable
,Comparable<ItemRestrictionType>
,Constable
Enumerates the possible ways in which an order item's
use by
offers
can be restricted depending on whether it meets an
offer's item qualifier criteria
or
target item criteria
. This class is used to translate the
combinations of the following offer fields into a series of simple enum values:
Offer.qualifiersCanBeQualifiers
Offer.qualifiersCanBeTargets
Offer#targetsCanBeTargets
Below is a mapping of the enum values to the combinations of the afore-mentioned fields:
NONE
:- for targets is the same as
targetsCanBeTargets == false
- for qualifiers is the same as
qualifiersCanBeQualifiers == false && qualifiersCanBeTargets == false
- for targets is the same as
QUALIFIER
- for targets is the same as another offer having already used the item as a qualifier and
qualifiersCanBeTargets = false
for that other offer. - for qualifiers is the same as
qualifiersCanBeQualifiers == true && qualifiersCanBeTargets == false
- for targets is the same as another offer having already used the item as a qualifier and
TARGET
:- for targets is the same as
targetsCanBeTargets == true
- for qualifiers is the same as
qualifiersCanBeQualifiers == false && qualifiersCanBeTargets == true
- for targets is the same as
QUALIFIER_TARGET
:- for qualifiers is the same as
qualifiersCanBeQualifiers == true && qualifiersCanBeTargets == true
- for qualifiers is the same as
- Author:
- Nathan Moore (nathanmoore).
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionTarget Item or Item Qualifier cannot be used in any way by more than 1 offer.Item Qualifier can be used as a qualifier by other offers but not as a target of other offers.Target Item or Item Qualifier can be used as a target or a qualifier by other offers.Target Item or Item Qualifier can be used as a target by other offers but not as a qualifier. -
Method Summary
Modifier and TypeMethodDescriptionstatic ItemRestrictionType
Returns the enum constant of this class with the specified name.static ItemRestrictionType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
Target Item or Item Qualifier cannot be used in any way by more than 1 offer. -
QUALIFIER
Item Qualifier can be used as a qualifier by other offers but not as a target of other offers. -
TARGET
Target Item or Item Qualifier can be used as a target by other offers but not as a qualifier. -
QUALIFIER_TARGET
Target Item or Item Qualifier can be used as a target or a qualifier by other offers.
-
-
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
-