Enum Class ProrationType

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

public enum ProrationType extends Enum<ProrationType>

Enumeration to determine whether an offer's discount is divided amongst different types of order items: Whether just "targets" or also "qualifiers".

Normally, the discount should go only to targets, that is, items specified as recipients of an offer's discount (see Offer.targetItemCriteria). However, the discount could also be applied to qualifiers, that is, items the present of which determine whether an order or other order items can receive a discount (see Offer.itemQualifierCriteria.

Author:
Chad Harchar (charchar)
  • Enum Constant Details

    • TARGET_ONLY

      public static final ProrationType TARGET_ONLY
      The discount is only applied to the targeted items of the offer. This is the normal use-case and default value.
    • TARGET_AND_QUALIFIER

      public static final ProrationType TARGET_AND_QUALIFIER
      The discount for an offer is spread across targeted and qualifying items.
  • Method Details

    • values

      public static ProrationType[] 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 ProrationType 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
    • isTargetOnlyProration

      public static boolean isTargetOnlyProration(String prorationType)
    • isTargetAndQualifierProration

      public static boolean isTargetAndQualifierProration(String prorationType)