Class SubscriptionAdjustment

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

public class SubscriptionAdjustment extends Object implements com.broadleafcommerce.data.tracking.core.ContextStateAware, Serializable
This is a representation of a price adjustment for a Subscription
See Also:
  • Constructor Details

  • Method Details

    • setAdjustmentType

      public void setAdjustmentType(SubscriptionAdjustmentType subscriptionAdjustmentType)
    • setSubscriptionAdjustmentType

      public void setSubscriptionAdjustmentType(String subscriptionAdjustmentType)
    • setAdjustmentId

      public void setAdjustmentId(String adjustmentId)
    • setId

      public void setId(String id)
    • getAdjustmentId

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

      public String getId()
    • getSubscriptionId

      public String getSubscriptionId()
      Reference to the Subscription 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 this adjustment
      See Also:
    • getAdjustmentAmount

      public BigDecimal getAdjustmentAmount()
      Amount of this adjustment
    • 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.
    • 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
    • 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
    • setSubscriptionId

      public void setSubscriptionId(String subscriptionId)
      Reference to the Subscription 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 this adjustment
    • 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.
    • 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
    • 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