Class CustomerImpl

java.lang.Object
org.broadleafcommerce.profile.core.domain.CustomerImpl
All Implemented Interfaces:
Serializable, org.broadleafcommerce.common.admin.domain.AdminMainEntity, org.broadleafcommerce.common.copy.MultiTenantCloneable<Customer>, org.broadleafcommerce.common.persistence.Previewable, Customer, CustomerAdminPresentation

@Entity public class CustomerImpl extends Object implements Customer, org.broadleafcommerce.common.admin.domain.AdminMainEntity, org.broadleafcommerce.common.persistence.Previewable, CustomerAdminPresentation
See Also:
  • Field Details

    • id

      protected Long id
    • auditable

      protected org.broadleafcommerce.common.audit.Auditable auditable
    • previewable

      protected org.broadleafcommerce.common.persistence.PreviewStatus previewable
    • username

      protected String username
    • password

      protected String password
    • emailAddress

      protected String emailAddress
    • firstName

      protected String firstName
    • lastName

      protected String lastName
    • externalId

      protected String externalId
    • challengeQuestion

      protected ChallengeQuestion challengeQuestion
    • challengeAnswer

      protected String challengeAnswer
    • passwordChangeRequired

      protected Boolean passwordChangeRequired

      If true, this customer must go through a reset password flow.

      During a site conversion or security breach or a matter of routine security policy, it may be necessary to require users to change their password. This property will not allow a user whose credentials are managed within Broadleaf to login until they have reset their password.

      Used by blUserDetailsService.

    • receiveEmail

      protected Boolean receiveEmail
    • registered

      protected Boolean registered
    • deactivated

      protected Boolean deactivated
    • customerLocale

      protected org.broadleafcommerce.common.locale.domain.Locale customerLocale
    • customerAttributes

      protected Map<String,CustomerAttribute> customerAttributes
    • customerAddresses

      protected List<CustomerAddress> customerAddresses
    • customerPhones

      protected List<CustomerPhone> customerPhones
    • customerPayments

      protected List<CustomerPayment> customerPayments
    • isTaxExempt

      protected Boolean isTaxExempt
    • taxExemptionCode

      protected String taxExemptionCode
    • unencodedPassword

      protected String unencodedPassword
    • unencodedChallengeAnswer

      protected String unencodedChallengeAnswer
    • anonymous

      protected boolean anonymous
    • cookied

      protected boolean cookied
    • loggedIn

      protected boolean loggedIn
    • transientProperties

      protected Map<String,Object> transientProperties
  • Constructor Details

    • CustomerImpl

      public CustomerImpl()
  • Method Details

    • getId

      public Long getId()
      Specified by:
      getId in interface Customer
    • setId

      public void setId(Long id)
      Specified by:
      setId in interface Customer
    • getUsername

      public String getUsername()
      Specified by:
      getUsername in interface Customer
    • setUsername

      public void setUsername(String username)
      Specified by:
      setUsername in interface Customer
    • getPassword

      public String getPassword()
      Specified by:
      getPassword in interface Customer
    • setPassword

      public void setPassword(String password)
      Specified by:
      setPassword in interface Customer
    • isPasswordChangeRequired

      public boolean isPasswordChangeRequired()
      Description copied from interface: Customer

      If true, this customer must go through a reset password flow.

      During a site conversion or security breach or a matter of routine security policy, it may be necessary to require users to change their password. This property will not allow a user whose credentials are managed within Broadleaf to login until they have reset their password.

      Used by blUserDetailsService.

      Specified by:
      isPasswordChangeRequired in interface Customer
    • setPasswordChangeRequired

      public void setPasswordChangeRequired(boolean passwordChangeRequired)
      Specified by:
      setPasswordChangeRequired in interface Customer
    • getFirstName

      public String getFirstName()
      Specified by:
      getFirstName in interface Customer
    • setFirstName

      public void setFirstName(String firstName)
      Specified by:
      setFirstName in interface Customer
    • getLastName

      public String getLastName()
      Specified by:
      getLastName in interface Customer
    • setLastName

      public void setLastName(String lastName)
      Specified by:
      setLastName in interface Customer
    • getEmailAddress

      public String getEmailAddress()
      Specified by:
      getEmailAddress in interface Customer
    • setEmailAddress

      public void setEmailAddress(String emailAddress)
      Specified by:
      setEmailAddress in interface Customer
    • getExternalId

      public String getExternalId()
      Specified by:
      getExternalId in interface Customer
    • setExternalId

      public void setExternalId(String externalId)
      Specified by:
      setExternalId in interface Customer
    • getChallengeQuestion

      public ChallengeQuestion getChallengeQuestion()
      Specified by:
      getChallengeQuestion in interface Customer
    • setChallengeQuestion

      public void setChallengeQuestion(ChallengeQuestion challengeQuestion)
      Specified by:
      setChallengeQuestion in interface Customer
    • getChallengeAnswer

      public String getChallengeAnswer()
      Specified by:
      getChallengeAnswer in interface Customer
    • setChallengeAnswer

      public void setChallengeAnswer(String challengeAnswer)
      Specified by:
      setChallengeAnswer in interface Customer
    • getUnencodedPassword

      public String getUnencodedPassword()
      Specified by:
      getUnencodedPassword in interface Customer
    • setUnencodedPassword

      public void setUnencodedPassword(String unencodedPassword)
      Specified by:
      setUnencodedPassword in interface Customer
    • isReceiveEmail

      public boolean isReceiveEmail()
      Specified by:
      isReceiveEmail in interface Customer
    • setReceiveEmail

      public void setReceiveEmail(boolean receiveEmail)
      Specified by:
      setReceiveEmail in interface Customer
    • isRegistered

      public boolean isRegistered()
      Specified by:
      isRegistered in interface Customer
    • setRegistered

      public void setRegistered(boolean registered)
      Specified by:
      setRegistered in interface Customer
    • getUnencodedChallengeAnswer

      public String getUnencodedChallengeAnswer()
      Specified by:
      getUnencodedChallengeAnswer in interface Customer
    • setUnencodedChallengeAnswer

      public void setUnencodedChallengeAnswer(String unencodedChallengeAnswer)
      Specified by:
      setUnencodedChallengeAnswer in interface Customer
    • getAuditable

      public org.broadleafcommerce.common.audit.Auditable getAuditable()
      Specified by:
      getAuditable in interface Customer
    • setAuditable

      public void setAuditable(org.broadleafcommerce.common.audit.Auditable auditable)
      Specified by:
      setAuditable in interface Customer
    • isAnonymous

      public boolean isAnonymous()
      Specified by:
      isAnonymous in interface Customer
    • setAnonymous

      public void setAnonymous(boolean anonymous)
      Specified by:
      setAnonymous in interface Customer
    • isCookied

      public boolean isCookied()
      Specified by:
      isCookied in interface Customer
    • setCookied

      public void setCookied(boolean cookied)
      Specified by:
      setCookied in interface Customer
    • isLoggedIn

      public boolean isLoggedIn()
      Specified by:
      isLoggedIn in interface Customer
    • setLoggedIn

      public void setLoggedIn(boolean loggedIn)
      Specified by:
      setLoggedIn in interface Customer
    • getCustomerLocale

      public org.broadleafcommerce.common.locale.domain.Locale getCustomerLocale()
      Specified by:
      getCustomerLocale in interface Customer
    • setCustomerLocale

      public void setCustomerLocale(org.broadleafcommerce.common.locale.domain.Locale customerLocale)
      Specified by:
      setCustomerLocale in interface Customer
    • getCustomerAttributes

      public Map<String,CustomerAttribute> getCustomerAttributes()
      Specified by:
      getCustomerAttributes in interface Customer
    • setCustomerAttributes

      public void setCustomerAttributes(Map<String,CustomerAttribute> customerAttributes)
      Specified by:
      setCustomerAttributes in interface Customer
    • isDeactivated

      public boolean isDeactivated()
      Description copied from interface: Customer
      Returns true if this user has been deactivated. Most implementations will not allow the user to login if they are deactivated.
      Specified by:
      isDeactivated in interface Customer
      Returns:
    • setDeactivated

      public void setDeactivated(boolean deactivated)
      Description copied from interface: Customer
      Sets the users deactivated status.
      Specified by:
      setDeactivated in interface Customer
    • getCustomerAddresses

      public List<CustomerAddress> getCustomerAddresses()
      Specified by:
      getCustomerAddresses in interface Customer
    • setCustomerAddresses

      public void setCustomerAddresses(List<CustomerAddress> customerAddresses)
      Specified by:
      setCustomerAddresses in interface Customer
    • getCustomerPhones

      public List<CustomerPhone> getCustomerPhones()
      Specified by:
      getCustomerPhones in interface Customer
    • setCustomerPhones

      public void setCustomerPhones(List<CustomerPhone> customerPhones)
      Specified by:
      setCustomerPhones in interface Customer
    • getCustomerPayments

      public List<CustomerPayment> getCustomerPayments()
      Specified by:
      getCustomerPayments in interface Customer
    • setCustomerPayments

      public void setCustomerPayments(List<CustomerPayment> customerPayments)
      Specified by:
      setCustomerPayments in interface Customer
    • getMainEntityName

      public String getMainEntityName()
      Specified by:
      getMainEntityName in interface org.broadleafcommerce.common.admin.domain.AdminMainEntity
    • getPreview

      public Boolean getPreview()
      Specified by:
      getPreview in interface org.broadleafcommerce.common.persistence.Previewable
    • setPreview

      public void setPreview(Boolean preview)
      Specified by:
      setPreview in interface org.broadleafcommerce.common.persistence.Previewable
    • getTransientProperties

      public Map<String,Object> getTransientProperties()
      Description copied from interface: Customer
      This returns a non-null map of transient properties that are not persisted to the database.
      Specified by:
      getTransientProperties in interface Customer
      Returns:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • createOrRetrieveCopyInstance

      public <G extends Customer> org.broadleafcommerce.common.copy.CreateResponse<G> createOrRetrieveCopyInstance(org.broadleafcommerce.common.copy.MultiTenantCopyContext context) throws CloneNotSupportedException
      Specified by:
      createOrRetrieveCopyInstance in interface org.broadleafcommerce.common.copy.MultiTenantCloneable<Customer>
      Throws:
      CloneNotSupportedException
    • getTaxExemptionCode

      public String getTaxExemptionCode()
      Description copied from interface: Customer
      The code used by an external system to determine if the user is tax exempt and/or what specific taxes the user is exempt from.
      Specified by:
      getTaxExemptionCode in interface Customer
      Returns:
      the code for this user's tax exemption reason, usually to just be passed to an external system
    • setTaxExemptionCode

      public void setTaxExemptionCode(String exemption)
      Description copied from interface: Customer
      Associates a tax exemption code to this user to notate tax exemption status. Default behavior in the org.broadleafcommerce.core.pricing.service.tax.provider.SimpleTaxProvider is that if this is set to any value then this customer is tax exempt.
      Specified by:
      setTaxExemptionCode in interface Customer
      Parameters:
      exemption - the tax exemption code for the customer
    • isTaxExempt

      public boolean isTaxExempt()
      Description copied from interface: Customer

      Convenience method to represent if this customer should be taxed or not when pricing their Order. Default behavior in the org.broadleafcommerce.core.pricing.service.tax.provider.SimpleTaxProvider is that if there is anything in Customer.getTaxExemptionCode() then the customer is exempt.

      If you assign special meaning to the Customer.getTaxExemptionCode() then this might be different and you should determine specific tax exemption based on Customer.getTaxExemptionCode()

      Specified by:
      isTaxExempt in interface Customer
      Returns:
      whether or not this customer is exempt from tax calculations