Class SubscriptionItemAdjustment

java.lang.Object
com.broadleafcommerce.subscription.domain.adjustment.SubscriptionItemAdjustment
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware

public class SubscriptionItemAdjustment extends Object implements com.broadleafcommerce.data.tracking.core.ContextStateAware
This represents a line item price adjustment for a Subscription
  • Constructor Details

  • Method Details

    • setAdjustmentType

      public void setAdjustmentType(SubscriptionAdjustmentType subscriptionAdjustmentType)
    • setSubscriptionAdjustmentType

      public void setSubscriptionAdjustmentType(String subscriptionAdjustmentType)
    • setItemAdjustmentId

      public void setItemAdjustmentId(String itemAdjustmentId)
    • setId

      public void setId(String id)
    • getItemAdjustmentId

      @Deprecated public String getItemAdjustmentId()
      Deprecated.
      Use getId() field instead
    • getId

      public String getId()
    • getSubscriptionItemId

      public String getSubscriptionItemId()
      Reference to the SubscriptionItem whose price this adjusts
    • getAdjustmentRef

      public String getAdjustmentRef()
      Reference to the promotion or offer that drives this adjustment
    • getAdjustmentType

      @Deprecated public SubscriptionAdjustmentType getAdjustmentType()
      Deprecated.
    • getSubscriptionAdjustmentType

      public String getSubscriptionAdjustmentType()
      Type of adjustment that this adds
      See Also:
    • getAdjustmentAmount

      public BigDecimal getAdjustmentAmount()
      Amount of the price adjustment. This could be a percentage, amount off, or fixed price. Use with subscriptionAdjustmentType to determine which option is applicable.
    • getBeginPeriod

      public Integer getBeginPeriod()
      Number of the billing period this adjustment starts being active
    • getEndPeriod

      public Integer getEndPeriod()
      Number of the billing period this adjustment stops. If this field is null, the adjustment is considered indefinite
    • getAdjustmentName

      public String getAdjustmentName()
      Name of the adjustment applied.
    • getAdjustmentCartLabel

      public String getAdjustmentCartLabel()
      Friendly label to display in the cart or to a customer in general instead of the adjustmentName.
    • getAdjustmentDescription

      public String getAdjustmentDescription()
      A description of what benefits the adjustment provides to a customer.
    • getAdjustmentProrationType

      public String getAdjustmentProrationType()
      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.
    • getAdjustmentCodeRef

      public String getAdjustmentCodeRef()
      A reference to the Offer Code (if any).
    • getAdjustmentDiscountMethodType

      public String getAdjustmentDiscountMethodType()
      Determines the method used to apply the discount. Typically in Broadleaf, the getSubscriptionAdjustmentType() ends up as DefaultSubscriptionAdjustmentType.AMOUNT_OFF since 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.
    • getAdjustmentDiscountFactor

      public BigDecimal getAdjustmentDiscountFactor()
      The discount factor by which to discount a target. If the amount is 10, then whether it is calculated as a percentage (10%) or a currency amount ($10) is determined by getAdjustmentDiscountMethodType(). This does not represent that actual amount discounted from the target.
    • getCodeUsed

      public String getCodeUsed()
      The code used (if any) that triggered the application of the adjustment for this adjustment.
    • getCampaignTrackingId

      public String getCampaignTrackingId()
      The campaign tracking id (if any) for this adjustment.
    • getDiscountType

      public String getDiscountType()
      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.
    • getQualifierDetails

      public List<OfferItemDetail> getQualifierDetails()
      A list of OfferItemDetails representing 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

      public Integer getItemAdjustmentQuantity()
      The quantity of the SubscriptionItem the adjustment applies to. If null, then the full quantity of the item is targeted.
    • getFreeTrialLength

      public Integer getFreeTrialLength()
      If discountType is FREE_TRIAL, then this defines the free trial's length.
      See Also:
      • freeTrialLengthUnits
    • getFreeTrialLengthUnits

      public String getFreeTrialLengthUnits()
      If discountType is FREE_TRIAL, then this defines the units for freeTrialLength.
      See Also:
      • freeTrialLength
    • getCurrencyConversionDetail

      public CurrencyConversionDetail getCurrencyConversionDetail()
      Represents the details of the exchange rate used to convert a MonetaryAmount from 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

      public Map<String,Object> getAttributes()
      Miscellaneous attributes for this subscription item adjustment.
    • getContextState

      public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      getContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
    • setSubscriptionItemId

      public void setSubscriptionItemId(String subscriptionItemId)
      Reference to the SubscriptionItem whose price this adjusts
    • setAdjustmentRef

      public void setAdjustmentRef(String adjustmentRef)
      Reference to the promotion or offer that drives this adjustment
    • setAdjustmentAmount

      public void setAdjustmentAmount(BigDecimal adjustmentAmount)
      Amount of the price adjustment. This could be a percentage, amount off, or fixed price. Use with subscriptionAdjustmentType to determine which option is applicable.
    • setBeginPeriod

      public void setBeginPeriod(Integer beginPeriod)
      Number of the billing period this adjustment starts being active
    • setEndPeriod

      public void setEndPeriod(Integer endPeriod)
      Number of the billing period this adjustment stops. If this field is null, the adjustment is considered indefinite
    • setAdjustmentName

      public void setAdjustmentName(String adjustmentName)
      Name of the adjustment applied.
    • setAdjustmentCartLabel

      public void setAdjustmentCartLabel(String adjustmentCartLabel)
      Friendly label to display in the cart or to a customer in general instead of the adjustmentName.
    • setAdjustmentDescription

      public void setAdjustmentDescription(String adjustmentDescription)
      A description of what benefits the adjustment provides to a customer.
    • setAdjustmentProrationType

      public void setAdjustmentProrationType(String adjustmentProrationType)
      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.
    • setAdjustmentCodeRef

      public void setAdjustmentCodeRef(String adjustmentCodeRef)
      A reference to the Offer Code (if any).
    • setAdjustmentDiscountMethodType

      public void setAdjustmentDiscountMethodType(String adjustmentDiscountMethodType)
      Determines the method used to apply the discount. Typically in Broadleaf, the getSubscriptionAdjustmentType() ends up as DefaultSubscriptionAdjustmentType.AMOUNT_OFF since 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.
    • setAdjustmentDiscountFactor

      public void setAdjustmentDiscountFactor(BigDecimal adjustmentDiscountFactor)
      The discount factor by which to discount a target. If the amount is 10, then whether it is calculated as a percentage (10%) or a currency amount ($10) is determined by getAdjustmentDiscountMethodType(). This does not represent that actual amount discounted from the target.
    • setCodeUsed

      public void setCodeUsed(String codeUsed)
      The code used (if any) that triggered the application of the adjustment for this adjustment.
    • setCampaignTrackingId

      public void setCampaignTrackingId(String campaignTrackingId)
      The campaign tracking id (if any) for this adjustment.
    • setDiscountType

      public void setDiscountType(String discountType)
      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.
    • setQualifierDetails

      public void setQualifierDetails(List<OfferItemDetail> qualifierDetails)
      A list of OfferItemDetails representing 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

      public void setItemAdjustmentQuantity(Integer itemAdjustmentQuantity)
      The quantity of the SubscriptionItem the adjustment applies to. If null, then the full quantity of the item is targeted.
    • setFreeTrialLength

      public void setFreeTrialLength(Integer freeTrialLength)
      If discountType is FREE_TRIAL, then this defines the free trial's length.
      See Also:
      • freeTrialLengthUnits
    • setFreeTrialLengthUnits

      public void setFreeTrialLengthUnits(String freeTrialLengthUnits)
      If discountType is FREE_TRIAL, then this defines the units for freeTrialLength.
      See Also:
      • freeTrialLength
    • setCurrencyConversionDetail

      public void setCurrencyConversionDetail(CurrencyConversionDetail currencyConversionDetail)
      Represents the details of the exchange rate used to convert a MonetaryAmount from 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

      public void setAttributes(Map<String,Object> attributes)
      Miscellaneous attributes for this subscription item adjustment.
    • setContextState

      public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      setContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object