Class CustomerContext
java.lang.Object
com.broadleafcommerce.promotion.offer.client.web.context.CustomerContext
- All Implemented Interfaces:
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The id for the account that is in the current context.The id for the customer that is in the current context.The list of id's that correspond to customer segments that this customer is a part of.The customer's username.int
hashCode()
boolean
Whether the customer is authenticated.void
setAccountId
(String accountId) The id for the account that is in the current context.void
setAuthenticated
(boolean authenticated) Whether the customer is authenticated.void
setCustomerId
(String customerId) The id for the customer that is in the current context.void
setCustomerSegmentIds
(Set<String> customerSegmentIds) The list of id's that correspond to customer segments that this customer is a part of.void
setUsername
(String username) The customer's username.toString()
-
Field Details
-
CUSTOMER_CONTEXT_HEADER
- See Also:
-
-
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
The id for the customer that is in the current context.- Returns:
- The id for the customer that is in the current context.
-
getUsername
The customer's username.- Returns:
- The customer's username.
-
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
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
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
The customer's username.- Parameters:
username
- The customer's username.
-
setAccountId
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
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
-
canEqual
-
hashCode
public int hashCode() -
toString
-