Class ExistingAdjustmentDetail
java.lang.Object
com.broadleafcommerce.cartoperation.domain.subscription.ExistingAdjustmentDetail
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ExistingSubscriptionAdjustmentDetail,ExistingSubscriptionItemAdjustmentDetail
Represents details of an existing adjustment when entering a modify-subscription flow such as for
edit, upgrade, or downgrade.
This is helpful to avoid any existing adjustments from being lost after modifying a subscription.
- Since:
- Cart Operation Service 2.3.0, Release Train 2.3.0
- Author:
- Sunny Yu
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanThe name of the adjustment, the name of the applied offer by default.The reference of the adjustment, the id of the applied offer by default.Defines the type of the discount, e.g., free trial, order discount, future credit, etc.Additional attributes to include.Number of the billing period this adjustment starts being active.Number of the billing period this adjustment stops.The end date of the free trial for this subscription, if applicable, null if none applied.getId()intRepresents the number of periods this adjustment has already been used.inthashCode()booleanDetermines whether this adjustment is still usable based on thefreeTrialEndDateorperiodsAlreadyUsed.voidsetAdjustmentName(String adjustmentName) The name of the adjustment, the name of the applied offer by default.voidsetAdjustmentRef(String adjustmentRef) The reference of the adjustment, the id of the applied offer by default.voidsetAdjustmentType(String adjustmentType) Defines the type of the discount, e.g., free trial, order discount, future credit, etc.voidsetAttributes(Map<String, Object> attributes) Additional attributes to include.voidsetBeginPeriod(Integer beginPeriod) Number of the billing period this adjustment starts being active.voidsetEndPeriod(Integer endPeriod) Number of the billing period this adjustment stops.voidsetFreeTrialEndDate(Instant freeTrialEndDate) The end date of the free trial for this subscription, if applicable, null if none applied.voidvoidsetPeriodsAlreadyUsed(int periodsAlreadyUsed) Represents the number of periods this adjustment has already been used.toString()
-
Constructor Details
-
ExistingAdjustmentDetail
public ExistingAdjustmentDetail()
-
-
Method Details
-
isAdjustmentUsable
public boolean isAdjustmentUsable()Determines whether this adjustment is still usable based on thefreeTrialEndDateorperiodsAlreadyUsed. -
getId
-
getAdjustmentRef
The reference of the adjustment, the id of the applied offer by default. -
getAdjustmentName
The name of the adjustment, the name of the applied offer by default. -
getAdjustmentType
Defines the type of the discount, e.g., free trial, order discount, future credit, etc. This primarily determines when it should be applied to the order or items. This helps distinguish whether the adjustment applies at checkout or later such as for a subscription.- See Also:
-
DefaultAdjustmentType
-
getBeginPeriod
Number of the billing period this adjustment starts being active. -
getEndPeriod
Number of the billing period this adjustment stops. If this field is null, the adjustment is considered indefinite -
getFreeTrialEndDate
The end date of the free trial for this subscription, if applicable, null if none applied.This is an easy way to determine if a subscription is in a free trial period without having to calculate from the adjustment.
-
getPeriodsAlreadyUsed
public int getPeriodsAlreadyUsed()Represents the number of periods this adjustment has already been used. This is helpful to determine if the adjustment has any remaining periods. -
getAttributes
Additional attributes to include. -
setId
-
setAdjustmentRef
The reference of the adjustment, the id of the applied offer by default. -
setAdjustmentName
The name of the adjustment, the name of the applied offer by default. -
setAdjustmentType
Defines the type of the discount, e.g., free trial, order discount, future credit, etc. This primarily determines when it should be applied to the order or items. This helps distinguish whether the adjustment applies at checkout or later such as for a subscription.- See Also:
-
DefaultAdjustmentType
-
setBeginPeriod
Number of the billing period this adjustment starts being active. -
setEndPeriod
Number of the billing period this adjustment stops. If this field is null, the adjustment is considered indefinite -
setFreeTrialEndDate
The end date of the free trial for this subscription, if applicable, null if none applied.This is an easy way to determine if a subscription is in a free trial period without having to calculate from the adjustment.
-
setPeriodsAlreadyUsed
public void setPeriodsAlreadyUsed(int periodsAlreadyUsed) Represents the number of periods this adjustment has already been used. This is helpful to determine if the adjustment has any remaining periods. -
setAttributes
Additional attributes to include. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-