java.lang.Object
com.broadleafcommerce.promotion.offer.client.web.context.info.ExistingOfferRef
All Implemented Interfaces:
Serializable

public class ExistingOfferRef extends Object implements Serializable
Slimmed-down reference to an offer just like an OfferRef, but is used to represent an offer that is already applied.

This is meant to represent existing offers that are already applied, used for post-purchase flows for subscription such as DefaultOrderFlow.SUBSCRIPTION_EDIT, DefaultOrderFlow.SUBSCRIPTION_UPGRADE, etc.

Since:
2.0.4
Author:
Sunny Yu
See Also:
  • Constructor Details

    • ExistingOfferRef

      public ExistingOfferRef()
  • Method Details

    • getId

      public String getId()
      The context ID of the offer.
      Returns:
      the context ID of the offer.
    • getName

      public String getName()
      Display name for this offer.
      Returns:
      the name of this offer
    • getBeginPeriod

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

      @Nullable public Integer getEndPeriod()
      Number of the billing period this adjustment stops. If this field is null, the adjustment is considered indefinite
    • 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

      public Map<String,Object> getAttributes()
      Dynamic attributes that are a part of the offer.
      Returns:
      dynamic attributes that are a part of the offer
    • setId

      public void setId(String id)
      The context ID of the offer.
      Parameters:
      id - the context ID of the offer.
    • setName

      public void setName(String name)
      Display name for this offer.
      Parameters:
      name - the name of this offer
    • setBeginPeriod

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

      public void setEndPeriod(@Nullable Integer endPeriod)
      Number of the billing period this adjustment stops. If this field is null, the adjustment is considered indefinite
    • 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

      public void setAttributes(Map<String,Object> attributes)
      Dynamic attributes that are a part of the offer.
      Parameters:
      attributes - dynamic attributes that are a part of the offer
    • 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