Enum Class DiscountTargetType

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

public enum DiscountTargetType extends Enum<DiscountTargetType>
Enumerates the kinds of entities to which an Discount.getAmount() mount offer's discount} can apply. By default an offer's discount can apply to either the prices of an order or individual order items or to the fulfillment cost (e.g., shipping cost) of either individual items or a group of items that share fulfillment info (i.e., a fulfillment group).
Author:
Chad Harchar (charchar)
  • Enum Constant Details

    • ORDER

      public static final DiscountTargetType ORDER
      Determines that the offer's discount should apply to the order's price as a whole rather than individual items separately. That is, it will apply to the order subtotal, excluding no items (contrast with ORDER_ITEM).
    • ORDER_ITEM

      public static final DiscountTargetType ORDER_ITEM
      Determines that the offer's discount should apply to individual order items' prices separately. That is, it will apply only to certain item subtotals and not others (contrast with ORDER).
    • FULFILLMENT_GROUP

      public static final DiscountTargetType FULFILLMENT_GROUP
      Determines that the offer's discount should apply to the cost of fulfilling a group of items with the same fulfillment info (i.e., fulfillment group). This means that if a group of items share such info as destination address and payment method, the cost of fulfilling that group of items is discounted as a whole (contrast with FULFILLMENT_GROUP_ITEM)
    • FULFILLMENT_GROUP_ITEM

      public static final DiscountTargetType FULFILLMENT_GROUP_ITEM
      The offer's discount should apply to the cost of fulfilling individual items. That is and in contrast to FULFILLMENT_GROUP, only a single item's shipping is discounted rather than a whole group of items being shipped to the same place with the same billing info.
    • VOUCHER

      public static final DiscountTargetType VOUCHER
      The offer's discount results in a VOUCHER that can be applied to a future offer
  • Method Details

    • values

      public static DiscountTargetType[] 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 DiscountTargetType 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
    • isOrderOffer

      public static boolean isOrderOffer(String type)
    • isOrderItemOffer

      public static boolean isOrderItemOffer(String type)
    • isFulfillmentGroupOffer

      public static boolean isFulfillmentGroupOffer(String type)
    • isFulfillmentGroupItemOffer

      public static boolean isFulfillmentGroupItemOffer(String type)
    • isVoucherOffer

      public static boolean isVoucherOffer(String type)