Class 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:
    Serialized Form
    • Constructor Detail

      • CustomerContext

        public CustomerContext()
    • Method Detail

      • 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.
      • 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 ids that correspond to customer segments that this customer is a part of.
        Returns:
        The list of ids that correspond to customer segments that this customer is a part of.
      • 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.
      • 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 ids that correspond to customer segments that this customer is a part of.
        Parameters:
        customerSegmentIds - The list of ids that correspond to customer segments that this customer is a part of.
      • canEqual

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object