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

public class OfferRef extends Object implements Serializable
Slimmed-down reference to an offer.
Author:
Nathan Moore (nathanmoore).
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
     
    boolean
     
    Dynamic attributes that are a part of the offer.
    The tracking identifiers of the campaigns of which this offer is a part.
    A label for this offer typically used by the storefront.
    Description of this offer.
    The context ID of the offer.
    Display name for this offer.
    Determines how an offer's discount amount is distributed across the offer's related order item types.
    int
     
    boolean
    Whether the offer is marked as combinable, meaning that it can be combined with other offers.
    boolean
    Future credit means that the associated adjustment will be discounted at a later time to the user via a credit.
    boolean
    Deprecated.
    since 1.6, in favor of offer stacking and combinability
    boolean
    Whether the offer is marked as totalitarian, meaning that it can be the only offer applied..
    void
    Dynamic attributes that are a part of the offer.
    void
    setCampaignTrackingIds(Set<String> campaignTrackingIds)
    The tracking identifiers of the campaigns of which this offer is a part.
    void
    setCartLabel(String cartLabel)
    A label for this offer typically used by the storefront.
    void
    setCombinable(boolean combinable)
    Whether the offer is marked as combinable, meaning that it can be combined with other offers.
    void
    setDescription(String description)
    Description of this offer.
    void
    setFutureCredit(boolean futureCredit)
    Future credit means that the associated adjustment will be discounted at a later time to the user via a credit.
    void
    The context ID of the offer.
    void
    Display name for this offer.
    void
    setProrationType(String prorationType)
    Determines how an offer's discount amount is distributed across the offer's related order item types.
    void
    setTargetsCanBeTargets(boolean targetsCanBeTargets)
    Deprecated.
    since 1.6, in favor of offer stacking and combinability
    void
    setTotalitarian(boolean totalitarian)
    Whether the offer is marked as totalitarian, meaning that it can be the only offer applied..
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • OfferRef

      public OfferRef()
  • 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
    • getDescription

      public String getDescription()
      Description of this offer.
      Returns:
      Description of this offer.
    • isTotalitarian

      public boolean isTotalitarian()
      Whether the offer is marked as totalitarian, meaning that it can be the only offer applied..
      Returns:
      Whether the offer is marked as totalitarian, meaning that it can be the only offer applied.
    • isCombinable

      public boolean isCombinable()
      Whether the offer is marked as combinable, meaning that it can be combined with other offers.
      Returns:
      Whether the offer is marked as combinable, meaning that it can be combined with other offers.
    • isFutureCredit

      public boolean isFutureCredit()
      Future credit means that the associated adjustment will be discounted at a later time to the user via a credit. It is up to the implementor to decide how to achieve this.
      Returns:
      Whether the offer is to be discounted at a later time and date.
    • isTargetsCanBeTargets

      @Deprecated public boolean isTargetsCanBeTargets()
      Deprecated.
      since 1.6, in favor of offer stacking and combinability
      Determines whether items that this offer targets to receive its discount can also receive discounts from other offers. For example, if this offer targets all "red t-shirts" with a 10% discount and another offer targets all "shirts" for a $5 discount, then this field determines whether that "red t-shirt" receives both discounts (whatever the best combination of the 2 is) or only the better offer of the 2. Default is false: A target can only receive a discount from 1 offer (the best one).
      Returns:
      Determines whether items that this offer targets to receive its discount can also receive discounts from other offers.
    • getCartLabel

      public String getCartLabel()
      A label for this offer typically used by the storefront.
      Returns:
      A label for this offer typically used by the storefront.
    • getProrationType

      public String getProrationType()
      Determines how an offer's discount amount is distributed across the offer's related order item types. This can either be set to prorate across target items or target and qualifier items.

      This property is used downstream in `OrderOperationServices` or other custom services to calculate the proper refund amounts when factoring in offer discounts.

      Returns:
      The type of order items that this discount is prorated across.
    • getCampaignTrackingIds

      public Set<String> getCampaignTrackingIds()
      The tracking identifiers of the campaigns of which this offer is a part. See com.broadleafcommerce.promotion.campaign.domain.Campaign#id
      Returns:
      The tracking codes of the campaigns of which this offer is a part
    • 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
    • setDescription

      public void setDescription(String description)
      Description of this offer.
      Parameters:
      description - Description of this offer.
    • setTotalitarian

      public void setTotalitarian(boolean totalitarian)
      Whether the offer is marked as totalitarian, meaning that it can be the only offer applied..
      Parameters:
      totalitarian - Whether the offer is marked as totalitarian, meaning that it can be the only offer applied.
    • setCombinable

      public void setCombinable(boolean combinable)
      Whether the offer is marked as combinable, meaning that it can be combined with other offers.
      Parameters:
      combinable - Whether the offer is marked as combinable, meaning that it can be combined with other offers.
    • setFutureCredit

      public void setFutureCredit(boolean futureCredit)
      Future credit means that the associated adjustment will be discounted at a later time to the user via a credit. It is up to the implementor to decide how to achieve this.
      Parameters:
      futureCredit - Whether the offer is to be discounted at a later time and date.
    • setTargetsCanBeTargets

      @Deprecated public void setTargetsCanBeTargets(boolean targetsCanBeTargets)
      Deprecated.
      since 1.6, in favor of offer stacking and combinability
      Determines whether items that this offer targets to receive its discount can also receive discounts from other offers. For example, if this offer targets all "red t-shirts" with a 10% discount and another offer targets all "shirts" for a $5 discount, then this field determines whether that "red t-shirt" receives both discounts (whatever the best combination of the 2 is) or only the better offer of the 2. Default is false: A target can only receive a discount from 1 offer (the best one).
      Parameters:
      targetsCanBeTargets - Determines whether items that this offer targets to receive its discount can also receive discounts from other offers.
    • setCartLabel

      public void setCartLabel(String cartLabel)
      A label for this offer typically used by the storefront.
      Parameters:
      cartLabel - A label for this offer typically used by the storefront.
    • setProrationType

      public void setProrationType(String prorationType)
      Determines how an offer's discount amount is distributed across the offer's related order item types. This can either be set to prorate across target items or target and qualifier items.

      This property is used downstream in `OrderOperationServices` or other custom services to calculate the proper refund amounts when factoring in offer discounts.

      Parameters:
      prorationType - The type of order items that this discount is prorated across.
    • setCampaignTrackingIds

      public void setCampaignTrackingIds(Set<String> campaignTrackingIds)
      The tracking identifiers of the campaigns of which this offer is a part. See com.broadleafcommerce.promotion.campaign.domain.Campaign#id
    • 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