Class SubscriptionDiscount
java.lang.Object
com.broadleafcommerce.promotion.offer.domain.SubscriptionDiscount
- All Implemented Interfaces:
Serializable
Encapsulates all of the fields relevant to an
Offer.getSubscriptionDiscount()
offer's
subscription compatibility}. A subscription is an item that has a recurring billing cycle based
on a frequency and period. applyToFuturePeriods
must be true for the other fields to be
considered. When set to true, this requires the Discount.getTargetType()
offer's discount
target type} to be DiscountTargetType.ORDER_ITEM
or
DiscountTargetType.FULFILLMENT_GROUP_ITEM
. In addition, the
Offer#targetsCanBeTargets
must be false so that this is the only offer that can apply to
the subscription order item.- Author:
- Chad Harchar (charchar)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
int
The beginning period for which this offer should be applied.The ending period for which this offer should be applied.int
hashCode()
boolean
Whether an offer should be applied to items' future periods, i.e., items that have a recurring billing cycle based on a frequency and a period.boolean
Deprecated.void
setApplyToFuturePeriods
(boolean applyToFuturePeriods) Whether an offer should be applied to items' future periods, i.e., items that have a recurring billing cycle based on a frequency and a period.void
setBeginPeriod
(int beginPeriod) The beginning period for which this offer should be applied.void
setDiscountCurrentOrder
(boolean discountCurrentOrder) Deprecated.No longer relevant with the introduction ofLineItem.getStandardRecurringPrice()
.void
setEndPeriod
(Integer endPeriod) The ending period for which this offer should be applied.toString()
-
Constructor Details
-
SubscriptionDiscount
public SubscriptionDiscount()
-
-
Method Details
-
isApplyToFuturePeriods
public boolean isApplyToFuturePeriods()Whether an offer should be applied to items' future periods, i.e., items that have a recurring billing cycle based on a frequency and a period. If this is false, none of the other fields on this class will be considered. Default to false.- Returns:
- Whether an offer should be applied to items' future periods, i.e., items that have a recurring billing cycle based on a frequency and a period.
-
isDiscountCurrentOrder
Deprecated.No longer relevant with the introduction ofLineItem.getStandardRecurringPrice()
. The distinction between price types allows more granular control for subscription discounts.Whether to apply this discount to the current provided order. Otherwise, it will only apply to future billing cycles resulting from the current order. Default to true.- Returns:
- Whether to apply this discount to the current provided order. Otherwise, it will only apply to future billing cycles resulting from the current order.
-
getBeginPeriod
public int getBeginPeriod()The beginning period for which this offer should be applied. 1 refers to the first recurring billing period, and so on.- Returns:
- The beginning period for which this offer should be applied.
-
getEndPeriod
The ending period for which this offer should be applied. 1 refers to the first recurring billing period, and so on. Null and 0 indicate no end.- Returns:
- The ending period for which this offer should be applied.
-
setApplyToFuturePeriods
public void setApplyToFuturePeriods(boolean applyToFuturePeriods) Whether an offer should be applied to items' future periods, i.e., items that have a recurring billing cycle based on a frequency and a period. If this is false, none of the other fields on this class will be considered. Default to false.- Parameters:
applyToFuturePeriods
- Whether an offer should be applied to items' future periods, i.e., items that have a recurring billing cycle based on a frequency and a period.
-
setDiscountCurrentOrder
Deprecated.No longer relevant with the introduction ofLineItem.getStandardRecurringPrice()
. The distinction between price types allows more granular control for subscription discounts.Whether to apply this discount to the current provided order. Otherwise, it will only apply to future billing cycles resulting from the current order. Default to true.- Parameters:
discountCurrentOrder
- Whether to apply this discount to the current provided order. Otherwise, it will only apply to future billing cycles resulting from the current order.
-
setBeginPeriod
public void setBeginPeriod(int beginPeriod) The beginning period for which this offer should be applied. 1 refers to the first recurring billing period, and so on.- Parameters:
beginPeriod
- The beginning period for which this offer should be applied.
-
setEndPeriod
The ending period for which this offer should be applied. 1 refers to the first recurring billing period, and so on. Null and 0 indicate no end.- Parameters:
endPeriod
- The ending period for which this offer should be applied.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
LineItem.getStandardRecurringPrice()
.