Enum Class ItemRestrictionType

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

public enum ItemRestrictionType extends Enum<ItemRestrictionType>

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
  • 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
  • TARGET:
    • for targets is the same as targetsCanBeTargets == true
    • for qualifiers is the same as qualifiersCanBeQualifiers == false && qualifiersCanBeTargets == true
  • QUALIFIER_TARGET:
    • for qualifiers is the same as qualifiersCanBeQualifiers == true && qualifiersCanBeTargets == true
Author:
Nathan Moore (nathanmoore).
See Also:
  • Enum Constant Details

    • NONE

      public static final ItemRestrictionType NONE
      Target Item or Item Qualifier cannot be used in any way by more than 1 offer.
    • QUALIFIER

      public static final ItemRestrictionType QUALIFIER
      Item Qualifier can be used as a qualifier by other offers but not as a target of other offers.
    • TARGET

      public static final ItemRestrictionType TARGET
      Target Item or Item Qualifier can be used as a target by other offers but not as a qualifier.
    • QUALIFIER_TARGET

      public static final ItemRestrictionType QUALIFIER_TARGET
      Target Item or Item Qualifier can be used as a target or a qualifier by other offers.
  • Method Details

    • values

      public static ItemRestrictionType[] 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 ItemRestrictionType 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