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 Details

    • 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 Details

    • values

      public static DefaultOfferProrationType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      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 name
      NullPointerException - if the argument is null
    • isTargetOnlyProration

      public static boolean isTargetOnlyProration(String prorationType)
    • isTargetAndQualifierProration

      public static boolean isTargetAndQualifierProration(String prorationType)