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

public class CustomerContext extends Object implements Serializable
DTO for holding customer information for determining which offers apply to a customer. Currently, this domain is only concerned with a single, logged-in customer's ID and the IDs of the customer segments to which that customer may apply. A "customer" is Broadleaf parlance that may be understood as a singular user of the store. A "customer segment" is just a grouping of related customers by a customer attribute like membership or logged-in status or by a request attribute like the presence of an affiliate tracking code in the URL, a search keyword, or having been sent from a particular device type.
Author:
Chad Harchar (charchar)
See Also:
  • Field Details

  • Constructor Details

    • CustomerContext

      public CustomerContext()
  • Method Details

    • isAuthenticated

      public boolean isAuthenticated()
      Whether the customer is authenticated.
      Returns:
      Whether the customer is authenticated
      Since:
      1.8.6
    • getCustomerId

      public String getCustomerId()
      The id for the customer that is in the current context.
      Returns:
      The id for the customer that is in the current context.
    • getUsername

      public String getUsername()
      The customer's username.
      Returns:
      The customer's username.
    • getAccountId

      public String getAccountId()
      The id for the account that is in the current context.
      Returns:
      The id for the account that is in the current context.
    • getCustomerSegmentIds

      public Set<String> getCustomerSegmentIds()
      The list of id's that correspond to customer segments that this customer is a part of.
      Returns:
      The list of id's that correspond to customer segments that this customer is a part of.
    • setAuthenticated

      public void setAuthenticated(boolean authenticated)
      Whether the customer is authenticated.
      Parameters:
      authenticated - Whether the customer is authenticated
      Since:
      1.8.6
    • setCustomerId

      public void setCustomerId(String customerId)
      The id for the customer that is in the current context.
      Parameters:
      customerId - The id for the customer that is in the current context.
    • setUsername

      public void setUsername(String username)
      The customer's username.
      Parameters:
      username - The customer's username.
    • setAccountId

      public void setAccountId(String accountId)
      The id for the account that is in the current context.
      Parameters:
      accountId - The id for the account that is in the current context.
    • setCustomerSegmentIds

      public void setCustomerSegmentIds(Set<String> customerSegmentIds)
      The list of id's that correspond to customer segments that this customer is a part of.
      Parameters:
      customerSegmentIds - The list of id's that correspond to customer segments that this customer is a part of.
    • 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