Class SubscriptionDiscount
- java.lang.Object
-
- com.broadleafcommerce.promotion.offer.domain.SubscriptionDiscount
-
- All Implemented Interfaces:
Serializable
public class SubscriptionDiscount extends Object implements Serializable
Encapsulates all of the fields relevant to anoffer's subscription compatibility. A subscription is an item that has a recurring billing cycle based on a frequency and period.applyToFuturePeriodsmust be true for the other fields to be considered. When set to true, this requires theoffer's discount target typeto beDiscountTargetType.ORDER_ITEMorDiscountTargetType.FULFILLMENT_GROUP_ITEM. In addition, theOffer#targetsCanBeTargetsmust be false so that this is the only offer that can apply to the subscription order item.- Author:
- Chad Harchar (charchar)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SubscriptionDiscount()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)booleanequals(Object o)intgetBeginPeriod()The beginning period for which this offer should be applied.intgetEndPeriod()The ending period for which this offer should be applied.inthashCode()booleanisApplyToFuturePeriods()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.booleanisDiscountCurrentOrder()Whether to apply this discount to the current provided order.voidsetApplyToFuturePeriods(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.voidsetBeginPeriod(int beginPeriod)The beginning period for which this offer should be applied.voidsetDiscountCurrentOrder(boolean discountCurrentOrder)Whether to apply this discount to the current provided order.voidsetEndPeriod(int endPeriod)The ending period for which this offer should be applied.StringtoString()
-
-
-
Method Detail
-
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
public boolean isDiscountCurrentOrder()
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
public int getEndPeriod()
The ending period for which this offer should be applied. 1 refers to the first recurring billing period, and so on.- 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
public void setDiscountCurrentOrder(boolean 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. 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
public void setEndPeriod(int endPeriod)
The ending period for which this offer should be applied. 1 refers to the first recurring billing period, and so on.- Parameters:
endPeriod- The ending period for which this offer should be applied.
-
canEqual
protected boolean canEqual(Object other)
-
-