Class CustomerEntity

java.lang.Object
de.calamanari.pk.identitymap.CustomerEntity
All Implemented Interfaces:
Entity<java.lang.String>

public class CustomerEntity
extends java.lang.Object
implements Entity<java.lang.String>
Customer Entity - one of the business entities in this example.
Author:
Karl Eilebrecht
  • Constructor Summary

    Constructors
    Constructor Description
    CustomerEntity()
    Creates new customer entity
    CustomerEntity​(java.lang.String customerId, java.lang.String title, java.lang.String lastName, java.lang.String firstName, java.lang.String phone, java.lang.String email, boolean promotionOptIn)
    Creates new entity from the given data
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getEmail()
    Returns the customer's email address
    java.lang.String getFirstName()
    Returns the customer's first name
    java.lang.String getId()
    Returns the customer-Id
    java.lang.String getLastName()
    Returns the last name of customer
    java.lang.String getPhone()
    Returns the customer's phone number
    java.lang.String getTitle()
    Returns customer title
    boolean isPromotionOptIn()
    Returns whether the customer has agreed to receive advertisement media
    void setEmail​(java.lang.String email)
    Sets the customer's email address
    void setFirstName​(java.lang.String firstName)
    Sets the customer's first name
    void setId​(java.lang.String id)
    Sets the customer-Id
    void setLastName​(java.lang.String lastName)
    Sets the customer's last name
    void setPhone​(java.lang.String phone)
    Sets the customer's phone number
    void setPromotionOptIn​(boolean promotionOptIn)
    Sets the customer's promotion status, whether to participate in sales promotion actions or not
    void setTitle​(java.lang.String title)
    Sets the customer's title
    CustomerEntity shallowCopy()
    Creates a duplicate with the same values as this object
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CustomerEntity

      public CustomerEntity()
      Creates new customer entity
    • CustomerEntity

      public CustomerEntity​(java.lang.String customerId, java.lang.String title, java.lang.String lastName, java.lang.String firstName, java.lang.String phone, java.lang.String email, boolean promotionOptIn)
      Creates new entity from the given data
      Parameters:
      customerId - identifier
      title - person's title
      lastName - person's last name
      firstName - person's first name
      phone - telephone number
      email - emai-address
      promotionOptIn - opt-in-flag for promotion events
  • Method Details

    • getId

      public java.lang.String getId()
      Returns the customer-Id
      Specified by:
      getId in interface Entity<java.lang.String>
      Returns:
      id
    • setId

      public void setId​(java.lang.String id)
      Sets the customer-Id
      Parameters:
      id - identifier
    • getTitle

      public java.lang.String getTitle()
      Returns customer title
      Returns:
      title of customer
    • setTitle

      public void setTitle​(java.lang.String title)
      Sets the customer's title
      Parameters:
      title - person's title
    • getLastName

      public java.lang.String getLastName()
      Returns the last name of customer
      Returns:
      lastName
    • setLastName

      public void setLastName​(java.lang.String lastName)
      Sets the customer's last name
      Parameters:
      lastName - person's last name
    • getFirstName

      public java.lang.String getFirstName()
      Returns the customer's first name
      Returns:
      firstName first name
    • setFirstName

      public void setFirstName​(java.lang.String firstName)
      Sets the customer's first name
      Parameters:
      firstName - person's first name
    • getPhone

      public java.lang.String getPhone()
      Returns the customer's phone number
      Returns:
      phone
    • setPhone

      public void setPhone​(java.lang.String phone)
      Sets the customer's phone number
      Parameters:
      phone - telephone number
    • getEmail

      public java.lang.String getEmail()
      Returns the customer's email address
      Returns:
      email
    • setEmail

      public void setEmail​(java.lang.String email)
      Sets the customer's email address
      Parameters:
      email - email-address
    • isPromotionOptIn

      public boolean isPromotionOptIn()
      Returns whether the customer has agreed to receive advertisement media
      Returns:
      true if customer has agreed, otherwise (default) false
    • setPromotionOptIn

      public void setPromotionOptIn​(boolean promotionOptIn)
      Sets the customer's promotion status, whether to participate in sales promotion actions or not
      Parameters:
      promotionOptIn - true means the customer has agreed to receive advertisement media
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • shallowCopy

      Creates a duplicate with the same values as this object
      Returns:
      duplicate