## de.ix.jspTutorial.model
Class Customer

    java.lang.Object
      |
      +--de.ix.jspTutorial.model.Customer

public class Customer
extends java.lang.Object
implements I_DatabaseObject, XMLConstants, XMLModelInterface

Definition of a pizza online shop customer

Version:
  $Id:$
Author:
  Peter Rossbach (pr@webapp.de), Lars Röwekamp ( lars.roewekamp@openKnowledge.de)

Field Summary
`private java.lang.String` `address1` first address row
`private java.lang.String` `address2` second address row
`private java.lang.String` `eMail` e-mail address
`private java.lang.String` `firstname` firstname
`private long` `id` Unique customer id
`private java.lang.String` `lastname` lastname
`private java.lang.String` `town` town
`static java.lang.String` `vcid` version of the source
`private java.lang.String` `zip` zip code

Fields inherited from interface de.ix.jspTutorial.database.I_DatabaseObject
`vcid`

Fields inherited from interface de.ix.jspTutorial.constants.XMLConstants
`XML_ADDRESS1_TAG, XML_ADDRESS2_TAG, XML_CUSTOMER_TAG, XML_DESCRIPTION_TAG, XML_EMAIL_TAG, XML_FIRSTNAME_TAG, XML_INGREDIENT_LIST_TAG, XML_INGREDIENT_TAG, XML_LASTNAME_TAG, XML_NAME_TAG, XML_ORDER_TAG, XML_PERSONAL_PIZZA_TAG, XML_PRICE_TAG, XML_ROOT_TAG, XML_SIZE_TAG, XML_TOWN_TAG, XML_ZIP_TAG`

Constructor Summary
`Customer()` Constructor sets the id to -1 an all strings to the empty string.
`Customer(long id, java.lang.String firstname, java.lang.String lastname, java.lang.String address1, java.lang.String address2, java.lang.String zip, java.lang.String town, java.lang.String eMail)` Constructor to set all attributes of the customer.

Method Summary
`org.w3c.dom.Element` `generateXML(org.w3c.dom.Document document)` method to generate XML Element containing all important `Customer` information
`java.lang.String` `getAddress1()` Getter method for the attribute `address1`
`java.lang.String` `getAddress2()` Getter method for the attribute `address2`
`java.lang.String` `getEmail()` Getter method for the attribute `eMail`
`java.lang.String` `getFirstname()` Getter method for the attribute `firstname`
`DatabaseGenericObject` `getGenericObject()` Method to create a generic object
`long` `getId()` Getter method for the attribute `id`
`java.lang.String` `getLastname()` Getter method for the attribute `lastname`
`java.lang.String` `getTown()` Getter method for the attribute `town`
`java.lang.String` `getZip()` Getter method for the attribute `zip`
`void` `set(Customer newCustomerValue)` Set all attributes to the values of a second customer object.
`void` `setAddress1(java.lang.String newAddress1)` Setter method for the attribute `address1`
`void` `setAddress2(java.lang.String newAddress2)` Setter method for the attribute `address2`
`void` `setEmail(java.lang.String newEMail)` Setter method for the attribute `id`
`void` `setFirstname(java.lang.String newFirstname)` Setter method for the attribute `firstname`
`void` `setId(long newId)` Setter method for the attribute `id`
`void` `setLastname(java.lang.String newLastname)` Setter method for the attribute `lastname`
`void` `setTown(java.lang.String newTown)` Setter method for the attribute `town`
`void` `setZip(java.lang.String newZip)` Setter method for the attribute `zip`
`java.lang.String` `toString()` Build a string out of the customer attributes.

Methods inherited from class java.lang.Object
`<clinit>, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait`

Field Detail

### vcid

    public static java.lang.String vcid

  version of the source

### id

    private long id

  Unique customer id

### firstname

    private java.lang.String firstname

  firstname

### lastname

    private java.lang.String lastname

  lastname

### address1

    private java.lang.String address1

  first address row

### address2

    private java.lang.String address2

  second address row

### town

    private java.lang.String town

  town

### zip

    private java.lang.String zip

  zip code

### eMail

    private java.lang.String eMail

  e-mail address

Constructor Detail

### Customer

    public Customer()

  Constructor sets the id to -1 an all strings to the empty string.

### Customer

    public Customer(long id,
                    java.lang.String firstname,
                    java.lang.String lastname,
                    java.lang.String address1,
                    java.lang.String address2,
                    java.lang.String zip,
                    java.lang.String town,
                    java.lang.String eMail)

  Constructor to set all attributes of the customer.
  Parameters:
    `firstname` - Firstname
    `lastname` - Lastname
    `address1` - First row of the address
    `address2` - Second row of the address
    `zip` - zip code
    `town` - town
    `eMail` - current e-mail address
    `id` - unique id

Method Detail

### set

    public void set(Customer newCustomerValue)

  Set all attributes to the values of a second customer object.
  Parameters:
    `newCustomerValue` - new values for the customer

### getGenericObject

    public DatabaseGenericObject getGenericObject()

  Method to create a generic object
  Returns:
    a DatabaseGenericObject
  See Also:
    `DatabaseGenericModifier.create(I_DatabaseGenericObject,String)`

### setFirstname

    public void setFirstname(java.lang.String newFirstname)

  Setter method for the attribute `firstname`
  Parameters:
    `newFirstname` - new value for the attribute firstname
  See Also:
    `getFirstname()`

### getFirstname

    public java.lang.String getFirstname()

  Getter method for the attribute `firstname`
  Returns:
    current value of the attribute firstname
  See Also:
    `setFirstname(String)`

### setLastname

    public void setLastname(java.lang.String newLastname)

  Setter method for the attribute `lastname`
  Parameters:
    `newLastname` - new value for the attribute lastname
  See Also:
    `getLastname()`

### getLastname

    public java.lang.String getLastname()

  Getter method for the attribute `lastname`
  Returns:
    current value of the attribute lastname
  See Also:
    `setLastname(String)`

### setAddress1

    public void setAddress1(java.lang.String newAddress1)

  Setter method for the attribute `address1`
  Parameters:
    `newFirstname` - new value for the attribute address1
  See Also:
    `getAddress1()`

### getAddress1

    public java.lang.String getAddress1()

  Getter method for the attribute `address1`
  Returns:
    current value of the attribute address1
  See Also:
    `setAddress1(String)`

### setAddress2

    public void setAddress2(java.lang.String newAddress2)

  Setter method for the attribute `address2`
  Parameters:
    `newAddress` - new value for the attribute address2
  See Also:
    `getAddress2()`

### getAddress2

    public java.lang.String getAddress2()

  Getter method for the attribute `address2`
  Returns:
    current value of the attribute address2
  See Also:
    `setAddress2(String)`

### setZip

    public void setZip(java.lang.String newZip)

  Setter method for the attribute `zip`
  Parameters:
    `newZip` - new value for the attribute zip
  See Also:
    `getZip()`

### getZip

    public java.lang.String getZip()

  Getter method for the attribute `zip`
  Returns:
    current value of the attribute zip
  See Also:
    `setZip(String)`

### setTown

    public void setTown(java.lang.String newTown)

  Setter method for the attribute `town`
  Parameters:
    `newTown` - new value for the attribute town
  See Also:
    `getTown()`

### getTown

    public java.lang.String getTown()

  Getter method for the attribute `town`
  Returns:
    current value of the attribute town
  See Also:
    `setTown(String)`

### setEmail

    public void setEmail(java.lang.String newEMail)

  Setter method for the attribute `id`
  Parameters:
    `newId` - new value for the attribute id
  See Also:
    `getEmail()`

### getEmail

    public java.lang.String getEmail()

  Getter method for the attribute `eMail`
  Returns:
    current value of the attribute eMail
  See Also:
    `setEmail(String)`

### setId

    public void setId(long newId)

  Setter method for the attribute `id`
  Parameters:
    `newId` - new value for the attribute id
  See Also:
    `getId()`

### getId

    public long getId()

  Getter method for the attribute `id`
  Returns:
    current value of the attribute id
  See Also:
    `setId(long)`

### toString

    public java.lang.String toString()

  Build a string out of the customer attributes.
  Overrides:
    toString in class java.lang.Object
  Returns:
    String representation of the customer

### generateXML

    public org.w3c.dom.Element generateXML(org.w3c.dom.Document document)

  method to generate XML Element containing all important `Customer` information
  Specified by:
    generateXML in interface XMLModelInterface
  Parameters:
    `document` - XML Document, to create xml element
  Returns:
    xml element containing XML representation of PersonalPizza

~ Das iX JSP Tutorial III - © 2000 by Peter Roßbach ~