Class ResolveCustomerSegmentsRequest

java.lang.Object
com.broadleafcommerce.customer.domain.ResolveCustomerSegmentsRequest
All Implemented Interfaces:
Serializable

public class ResolveCustomerSegmentsRequest extends Object implements Serializable
Represents a request to resolve CustomerSegments matching a given context. It is expected to contain any useful details about a user to evaluate rule-based segments against.
Author:
Nathan Moore (nathandmoore)
See Also:
  • Constructor Details

    • ResolveCustomerSegmentsRequest

      public ResolveCustomerSegmentsRequest()
  • Method Details

    • getUserId

      public String getUserId()
      The user's id.
      Returns:
      The user's id.
    • getUsername

      public String getUsername()
      The user's username.
      Returns:
      The user's username.
    • getEmail

      public String getEmail()
      The user's email.
      Returns:
      The user's email.
    • getPhoneNumber

      public String getPhoneNumber()
      The user's phone number.
      Returns:
      The user's phone number.
    • getFullName

      public String getFullName()
      The user's full name.
      Returns:
      The user's full name.
    • isRegistered

      public boolean isRegistered()
      Defines whether the user is registered. If false, then the user is considered anonymous.
      Returns:
      Whether the user is registered.
    • getAccountId

      public String getAccountId()
      The ID of the account the user belongs to.
      Returns:
      The ID of the account of the user.
    • getRootAccountId

      public String getRootAccountId()
      The ID of the root account the account member belongs to.
      Returns:
      The ID of the root account of the account member.
    • getAccountHierarchy

      public List<String> getAccountHierarchy()
      The hierarchy of accounts, from the root account to the account member's account.

      For example, if we have this account setup, rootAcct -> subAcct (child of rootAcct) -> subSubAcct (child of subAcct), this field would be [rootAcct, subAcct, subSubAcct]. This is useful to have queries include sub-accounts.

      Returns:
      The hierarchy of accounts, from the root account to the account member's account.
    • getAttributes

      public Map<String,Object> getAttributes()
      Additional, arbitrary request attributes.
      Returns:
      Additional, arbitrary request attributes.
    • getPrefetchedSegmentIdsToEvaluate

      public List<String> getPrefetchedSegmentIdsToEvaluate()
      List of ids of any prefetched CustomerSegments to evaluate whether they apply to the request. This list will be used instead of looking up all rule-based or directly assigned customer segments.

      Typically, this will only include the ids of rule-based segments with evaluation type DefaultCustomerSegmentRuleEvaluationType.REAL_TIME as other segments should already be known from the user's auth token claims.

    • setUserId

      public void setUserId(String userId)
      The user's id.
      Parameters:
      userId - The user's id.
    • setUsername

      public void setUsername(String username)
      The user's username.
      Parameters:
      username - The user's username.
    • setEmail

      public void setEmail(String email)
      The user's email.
      Parameters:
      username - The user's email.
    • setPhoneNumber

      public void setPhoneNumber(String phoneNumber)
      The user's phone number.
      Parameters:
      username - The user's phone number.
    • setFullName

      public void setFullName(String fullName)
      The user's full name.
      Parameters:
      fullName - The user's full name.
    • setRegistered

      public void setRegistered(boolean registered)
      Defines whether the user is registered. If false, then the user is considered anonymous.
      Parameters:
      registered - Whether the user is registered.
    • setAccountId

      public void setAccountId(String accountId)
      The ID of the account the user belongs to.
      Parameters:
      accountId - The ID of the account of the user.
    • setRootAccountId

      public void setRootAccountId(String rootAccountId)
      The ID of the root account the account member belongs to.
      Parameters:
      rootAccountId - The ID of the root account of the account member.
    • setAccountHierarchy

      public void setAccountHierarchy(List<String> accountHierarchy)
      The hierarchy of accounts, from the root account to the account member's account.

      For example, if we have this account setup, rootAcct -> subAcct (child of rootAcct) -> subSubAcct (child of subAcct), this field would be [rootAcct, subAcct, subSubAcct]. This is useful to have queries include sub-accounts.

      Parameters:
      accountHierarchy - The hierarchy of accounts, from the root account to the account member's account.
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Additional, arbitrary request attributes.
      Parameters:
      additionalAttributes - Additional, arbitrary request attributes.
    • setPrefetchedSegmentIdsToEvaluate

      public void setPrefetchedSegmentIdsToEvaluate(List<String> prefetchedSegmentIdsToEvaluate)
      List of ids of any prefetched CustomerSegments to evaluate whether they apply to the request. This list will be used instead of looking up all rule-based or directly assigned customer segments.

      Typically, this will only include the ids of rule-based segments with evaluation type DefaultCustomerSegmentRuleEvaluationType.REAL_TIME as other segments should already be known from the user's auth token claims.

    • 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