Class SubscriptionItemAdjustment
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware,Adjustment,Serializable
Subscription- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanAdjustment amount applied to the unit price of the target item.Friendly label to display in the cart or to a customer in general instead of theAdjustment.getAdjustmentName().A reference to the Offer Code (if any).A description of what benefits the adjustment provides to a customer.The discount factor by which to discount a target.Determines the method used to apply the discount.Name of the adjustment applied.Determines how an adjustment's discount amount is distributed across the adjustment's related item types.The quantity of the target item's units the adjustment applies to.Reference to the promotion or offer that drives this adjustmentMiscellaneous attributes for this subscription item adjustment.Number of the billing period this adjustment starts being activeThe campaign tracking id (if any) for this adjustment.The code used (if any) that triggered the application of the adjustment for this adjustment.com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextStateA subset ofTrackinginformation to expose the context state for this object.com.broadleafcommerce.order.common.domain.CurrencyConversionDetailRepresents the details of the exchange rate used to convert aMonetaryAmountfrom one currency to another.Defines the type of the discount, e.g., free trial, order discount, future credit, etc.Number of the billing period this adjustment stops.IfAdjustment.getDiscountType()isFREE_TRIAL, then this defines the free trial's length.IfAdjustment.getDiscountType()isFREE_TRIAL, then this defines the units forAdjustment.getFreeTrialLength().getId()The quantity of theSubscriptionItemthe adjustment applies to.Identifier for the subscription entity that owns this adjustment, e.g., theSubscription ID.The type of subscription entity that owns this adjustment, e.g.,DefaultAdjustmentOwnerType.SUBSCRIPTION.List<com.broadleafcommerce.order.common.domain.OfferItemDetail>A list ofOfferItemDetailsrepresenting the qualifier items where this adjustment was from.Type of adjustment that this addsReference to theSubscriptionItemwhose price this adjustsinthashCode()voidsetAdjustmentAmount(BigDecimal adjustmentAmount) voidsetAdjustmentCartLabel(String adjustmentCartLabel) voidsetAdjustmentCodeRef(String adjustmentCodeRef) voidsetAdjustmentDescription(String adjustmentDescription) voidsetAdjustmentDiscountFactor(BigDecimal adjustmentDiscountFactor) voidsetAdjustmentDiscountMethodType(String adjustmentDiscountMethodType) voidsetAdjustmentName(String adjustmentName) voidsetAdjustmentProrationType(String adjustmentProrationType) voidsetAdjustmentRef(String adjustmentRef) voidsetAttributes(Map<String, Object> attributes) Miscellaneous attributes for this subscription item adjustment.voidsetBeginPeriod(Integer beginPeriod) voidsetCampaignTrackingId(String campaignTrackingId) voidsetCodeUsed(String codeUsed) voidsetContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.voidsetCurrencyConversionDetail(com.broadleafcommerce.order.common.domain.CurrencyConversionDetail currencyConversionDetail) Represents the details of the exchange rate used to convert aMonetaryAmountfrom one currency to another.voidsetDiscountType(String discountType) voidsetEndPeriod(Integer endPeriod) voidsetFreeTrialLength(Integer freeTrialLength) voidsetFreeTrialLengthUnits(String freeTrialLengthUnits) voidvoidsetItemAdjustmentQuantity(Integer itemAdjustmentQuantity) The quantity of theSubscriptionItemthe adjustment applies to.voidsetQualifierDetails(List<com.broadleafcommerce.order.common.domain.OfferItemDetail> qualifierDetails) A list ofOfferItemDetailsrepresenting the qualifier items where this adjustment was from.voidsetSubscriptionAdjustmentType(String subscriptionAdjustmentType) voidsetSubscriptionItemId(String subscriptionItemId) Reference to theSubscriptionItemwhose price this adjuststoString()
-
Constructor Details
-
SubscriptionItemAdjustment
public SubscriptionItemAdjustment()
-
-
Method Details
-
getOwnerId
Description copied from interface:AdjustmentIdentifier for the subscription entity that owns this adjustment, e.g., theSubscription ID.- Specified by:
getOwnerIdin interfaceAdjustment- Returns:
- Identifier for the subscription entity that owns this adjustment, e.g., the
Subscription ID. - See Also:
-
getOwnerType
Description copied from interface:AdjustmentThe type of subscription entity that owns this adjustment, e.g.,DefaultAdjustmentOwnerType.SUBSCRIPTION.- Specified by:
getOwnerTypein interfaceAdjustment- Returns:
- The type of subscription entity that owns this adjustment, e.g.,
DefaultAdjustmentOwnerType.SUBSCRIPTION. - See Also:
-
getAdjustmentQuantity
Description copied from interface:AdjustmentThe quantity of the target item's units the adjustment applies to. If null, then the full quantity of the item is targeted. Not applicable to all types of adjustments.- Specified by:
getAdjustmentQuantityin interfaceAdjustment- Returns:
- The quantity of the adjustment owner the adjustment applies to if applicable.
- See Also:
-
getId
-
getSubscriptionItemId
Reference to theSubscriptionItemwhose price this adjusts -
getAdjustmentRef
Description copied from interface:AdjustmentReference to the promotion or offer that drives this adjustment- Specified by:
getAdjustmentRefin interfaceAdjustment- Returns:
- Reference to the promotion or offer that drives this adjustment
- See Also:
-
getSubscriptionAdjustmentType
Description copied from interface:AdjustmentType of adjustment that this adds- Specified by:
getSubscriptionAdjustmentTypein interfaceAdjustment- Returns:
- Type of adjustment that this adds
- See Also:
-
getAdjustmentAmount
Description copied from interface:AdjustmentAdjustment amount applied to the unit price of the target item.- Specified by:
getAdjustmentAmountin interfaceAdjustment- Returns:
- Amount of the price adjustment
- See Also:
-
getBeginPeriod
Description copied from interface:AdjustmentNumber of the billing period this adjustment starts being active- Specified by:
getBeginPeriodin interfaceAdjustment- Returns:
- Number of the billing period this adjustment starts being active
- See Also:
-
getEndPeriod
Description copied from interface:AdjustmentNumber of the billing period this adjustment stops. If this field is null, the adjustment is considered indefinite- Specified by:
getEndPeriodin interfaceAdjustment- Returns:
- Number of the billing period this adjustment stops. If this field is null, the adjustment is considered indefinite
- See Also:
-
getAdjustmentName
Description copied from interface:AdjustmentName of the adjustment applied.- Specified by:
getAdjustmentNamein interfaceAdjustment- Returns:
- Name of the adjustment applied.
- See Also:
-
getAdjustmentCartLabel
Description copied from interface:AdjustmentFriendly label to display in the cart or to a customer in general instead of theAdjustment.getAdjustmentName().- Specified by:
getAdjustmentCartLabelin interfaceAdjustment- Returns:
- Friendly label to display in the cart or to a customer in general instead of the
Adjustment.getAdjustmentName(). - See Also:
-
getAdjustmentDescription
Description copied from interface:AdjustmentA description of what benefits the adjustment provides to a customer.- Specified by:
getAdjustmentDescriptionin interfaceAdjustment- Returns:
- A description of what benefits the adjustment provides to a customer.
- See Also:
-
getAdjustmentProrationType
Description copied from interface:AdjustmentDetermines how an adjustment's discount amount is distributed across the adjustment's related item types. This can either be set to prorate across target items or target and qualifier items.- Specified by:
getAdjustmentProrationTypein interfaceAdjustment- Returns:
- Determines how an adjustment's discount amount is distributed across the adjustment's related item types. This can either be set to prorate across target items or target and qualifier items.
- See Also:
-
getAdjustmentCodeRef
Description copied from interface:AdjustmentA reference to the Offer Code (if any).- Specified by:
getAdjustmentCodeRefin interfaceAdjustment- Returns:
- A reference to the Offer Code (if any).
- See Also:
-
getAdjustmentDiscountMethodType
Description copied from interface:AdjustmentDetermines the method used to apply the discount. Typically in Broadleaf, theAdjustment.getSubscriptionAdjustmentType()ends up asDefaultSubscriptionAdjustmentType.AMOUNT_OFFsince the offer system calculates the actual amount to discount even if the base offer was a percentage off or fixed price. This field then is distinguished as the actual method specified on the offer before it was applied.- Specified by:
getAdjustmentDiscountMethodTypein interfaceAdjustment- Returns:
- The type of discount method used for this adjustment.
- See Also:
-
getAdjustmentDiscountFactor
Description copied from interface:AdjustmentThe discount factor by which to discount a target. If the amount is10, then whether it is calculated as a percentage (10%) or a currency amount ($10) is determined byAdjustment.getAdjustmentDiscountMethodType(). This does not represent that actual amount discounted from the target.- Specified by:
getAdjustmentDiscountFactorin interfaceAdjustment- Returns:
- The discount factor used for this adjustment.
- See Also:
-
getCodeUsed
Description copied from interface:AdjustmentThe code used (if any) that triggered the application of the adjustment for this adjustment.- Specified by:
getCodeUsedin interfaceAdjustment- Returns:
- The code used (if any) that triggered the application of the adjustment for this adjustment.
- See Also:
-
getCampaignTrackingId
Description copied from interface:AdjustmentThe campaign tracking id (if any) for this adjustment.- Specified by:
getCampaignTrackingIdin interfaceAdjustment- Returns:
- The campaign tracking id (if any) for this adjustment.
- See Also:
-
getDiscountType
Description copied from interface:AdjustmentDefines 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.- Specified by:
getDiscountTypein interfaceAdjustment- Returns:
- The type of the discount.
- See Also:
-
getQualifierDetails
A list ofOfferItemDetailsrepresenting the qualifier items where this adjustment was from.For example, ItemA and ItemB qualify for a free gift offer, which results Item_FG to be added as a free gift item. These details are used to identify ItemA and ItemB from free gift item Item_FG using its adjustment.
Take another example, ItemA qualifies for a Buy 1 itemA Get 1 itemB free offer. These details are used to identity the qualifier item ItemA from target item ItemB.
-
getItemAdjustmentQuantity
The quantity of theSubscriptionItemthe adjustment applies to. If null, then the full quantity of the item is targeted. -
getFreeTrialLength
Description copied from interface:AdjustmentIfAdjustment.getDiscountType()isFREE_TRIAL, then this defines the free trial's length.- Specified by:
getFreeTrialLengthin interfaceAdjustment- Returns:
- If
Adjustment.getDiscountType()isFREE_TRIAL, then this defines the free trial's length. - See Also:
-
getFreeTrialLengthUnits
Description copied from interface:AdjustmentIfAdjustment.getDiscountType()isFREE_TRIAL, then this defines the units forAdjustment.getFreeTrialLength().- Specified by:
getFreeTrialLengthUnitsin interfaceAdjustment- Returns:
- If
Adjustment.getDiscountType()isFREE_TRIAL, then this defines the units forAdjustment.getFreeTrialLength(). - See Also:
-
getCurrencyConversionDetail
public com.broadleafcommerce.order.common.domain.CurrencyConversionDetail getCurrencyConversionDetail()Represents the details of the exchange rate used to convert aMonetaryAmountfrom one currency to another. This is used to describe the amount of the adjustment if it was converted from a base currency. This is done when the target item was in a different currency from the offer and was also converted, that is, the item's original currency was the same as that which the offer targets but its price was converted to another currency. -
getAttributes
Miscellaneous attributes for this subscription item adjustment. -
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()A subset ofTrackinginformation to expose the context state for this object.- Specified by:
getContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
-
setId
-
setSubscriptionItemId
Reference to theSubscriptionItemwhose price this adjusts -
setAdjustmentRef
- See Also:
-
setSubscriptionAdjustmentType
-
setAdjustmentAmount
- See Also:
-
setBeginPeriod
- See Also:
-
setEndPeriod
- See Also:
-
setAdjustmentName
- See Also:
-
setAdjustmentCartLabel
- See Also:
-
setAdjustmentDescription
- See Also:
-
setAdjustmentProrationType
- See Also:
-
setAdjustmentCodeRef
- See Also:
-
setAdjustmentDiscountMethodType
-
setAdjustmentDiscountFactor
- See Also:
-
setCodeUsed
- See Also:
-
setCampaignTrackingId
- See Also:
-
setDiscountType
- See Also:
-
setQualifierDetails
public void setQualifierDetails(List<com.broadleafcommerce.order.common.domain.OfferItemDetail> qualifierDetails) A list ofOfferItemDetailsrepresenting the qualifier items where this adjustment was from.For example, ItemA and ItemB qualify for a free gift offer, which results Item_FG to be added as a free gift item. These details are used to identify ItemA and ItemB from free gift item Item_FG using its adjustment.
Take another example, ItemA qualifies for a Buy 1 itemA Get 1 itemB free offer. These details are used to identity the qualifier item ItemA from target item ItemB.
-
setItemAdjustmentQuantity
The quantity of theSubscriptionItemthe adjustment applies to. If null, then the full quantity of the item is targeted. -
setFreeTrialLength
- See Also:
-
setFreeTrialLengthUnits
- See Also:
-
setCurrencyConversionDetail
public void setCurrencyConversionDetail(com.broadleafcommerce.order.common.domain.CurrencyConversionDetail currencyConversionDetail) Represents the details of the exchange rate used to convert aMonetaryAmountfrom one currency to another. This is used to describe the amount of the adjustment if it was converted from a base currency. This is done when the target item was in a different currency from the offer and was also converted, that is, the item's original currency was the same as that which the offer targets but its price was converted to another currency. -
setAttributes
Miscellaneous attributes for this subscription item adjustment. -
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.- Specified by:
setContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-