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

public class Codes extends Object implements Serializable
DTO containing codes used to apply offers to orders. These can be shared offer codes or tracking IDs for entities like Campaigns.
Author:
Nathan Moore (nathanmoore).
See Also:
  • Constructor Details

    • Codes

      public Codes()
  • Method Details

    • getAllCodes

      public Set<String> getAllCodes()
      Returns the combined set of sharedCodes and trackingIds. By default, the result is non-modifiable.
      Returns:
      the combined set of sharedCodes and trackingIds.
    • getSharedCodes

      public Set<String> getSharedCodes()
      Code strings added to the order that may be tied to an offer's shared codes and used to apply it.
      Returns:
      Code strings added to the order that may be tied to an offer's shared codes and used to apply it.
    • getTrackingIds

      public Set<String> getTrackingIds()
      Tracking ids associated with external systems like the Campaigns Service that could be tied to an offer's campaign tracking ids. This works with com.broadleafcommerce.promotion.campaign.domain.Campaign#id and assumes that the customer already meets usage and date requirements for using any corresponding offer.
      Returns:
      Tracking ids associated with external systems like the Campaigns Service that could be tied to an offer's campaign tracking ids.
    • getCodeUsedByTrackingId

      @Deprecated public Map<String,String> getCodeUsedByTrackingId()
      Deprecated.
      since this is not used after 2.0.0
      A map of codes used by tracking ids associated with external systems like the Campaigns Service that could be tied to an offer's campaign tracking ids. This works with com.broadleafcommerce.promotion.campaign.domain.Campaign#id and assumes that the customer already meets usage and date requirements for using any corresponding offer.

      This map is solely for populating Adjustment.getCodeUsed() when a campaign code is used in PromotionServices versions prior to 2.0.0.

      Returns:
      A map of codes by tracking ids associated with external systems like the Campaigns Service that could be tied to an offer's campaign tracking ids.
    • setSharedCodes

      public void setSharedCodes(Set<String> sharedCodes)
      Code strings added to the order that may be tied to an offer's shared codes and used to apply it.
      Parameters:
      sharedCodes - Code strings added to the order that may be tied to an offer's shared codes and used to apply it.
    • setTrackingIds

      public void setTrackingIds(Set<String> trackingIds)
      Tracking ids associated with external systems like the Campaigns Service that could be tied to an offer's campaign tracking ids. This works with com.broadleafcommerce.promotion.campaign.domain.Campaign#id and assumes that the customer already meets usage and date requirements for using any corresponding offer.
      Parameters:
      trackingIds - Tracking ids associated with external systems like the Campaigns Service that could be tied to an offer's campaign tracking ids.
    • setCodeUsedByTrackingId

      @Deprecated public void setCodeUsedByTrackingId(Map<String,String> codeUsedByTrackingId)
      Deprecated.
      since this is not used after 2.0.0
      A map of codes used by tracking ids associated with external systems like the Campaigns Service that could be tied to an offer's campaign tracking ids. This works with com.broadleafcommerce.promotion.campaign.domain.Campaign#id and assumes that the customer already meets usage and date requirements for using any corresponding offer.

      This map is solely for populating Adjustment.getCodeUsed() when a campaign code is used in PromotionServices versions prior to 2.0.0.

      Parameters:
      codesByTrackingId - A map of codes by tracking ids associated with external systems like the Campaigns Service that could be tied to an offer's campaign tracking ids.
    • 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