Class AddressEntity

java.lang.Object
de.calamanari.pk.transferobjectassembler.AddressEntity

public class AddressEntity
extends java.lang.Object
Address Entity - one of the business entities in this example.
Author:
Karl Eilebrecht
  • Constructor Summary

    Constructors
    Constructor Description
    AddressEntity()
    Creates new address entity
    AddressEntity​(java.lang.String addressId, java.lang.String customerId, java.lang.String street, java.lang.String zipCode, java.lang.String city, java.lang.String country, java.lang.String salutation)
    Creates new address entity from the given data
  • Method Summary

    Modifier and Type Method Description
    void fromDto​(AddressDto dto)
    Updates this entity from the given data transfer object
    java.lang.String getAddressId()
    Returns the address ID
    java.lang.String getCity()
    Returns the city name
    java.lang.String getCountry()
    Returns the country name
    java.lang.String getCustomerId()
    Returns the customer ID
    java.lang.String getSalutation()
    Returns salutation for letters
    java.lang.String getStreet()
    Returns street address
    java.lang.String getZipCode()
    Returns the zipcode
    void setAddressId​(java.lang.String addressId)
    Sets the address ID
    void setCity​(java.lang.String city)
    Sets the city name
    void setCountry​(java.lang.String country)
    Sets the country
    void setCustomerId​(java.lang.String customerId)
    Sets the customer ID
    void setSalutation​(java.lang.String salutation)
    Sets the salutation for letters
    void setStreet​(java.lang.String street)
    Sets street address
    void setZipCode​(java.lang.String zipCode)
    Sets the zipCode
    AddressDto toDto()
    Returns a corresponding data transfer object for this Address
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

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

    • AddressEntity

      public AddressEntity()
      Creates new address entity
    • AddressEntity

      public AddressEntity​(java.lang.String addressId, java.lang.String customerId, java.lang.String street, java.lang.String zipCode, java.lang.String city, java.lang.String country, java.lang.String salutation)
      Creates new address entity from the given data
      Parameters:
      addressId - identifier
      customerId - related customer's identifier
      street - address field
      zipCode - address field
      city - address field
      country - address field
      salutation - address field
  • Method Details

    • getAddressId

      public java.lang.String getAddressId()
      Returns the address ID
      Returns:
      addressId
    • setAddressId

      public void setAddressId​(java.lang.String addressId)
      Sets the address ID
      Parameters:
      addressId - identifier
    • getCustomerId

      public java.lang.String getCustomerId()
      Returns the customer ID
      Returns:
      customerId
    • setCustomerId

      public void setCustomerId​(java.lang.String customerId)
      Sets the customer ID
      Parameters:
      customerId - related customer's identifier
    • getStreet

      public java.lang.String getStreet()
      Returns street address
      Returns:
      street
    • setStreet

      public void setStreet​(java.lang.String street)
      Sets street address
      Parameters:
      street - address field
    • getZipCode

      public java.lang.String getZipCode()
      Returns the zipcode
      Returns:
      zipCode
    • setZipCode

      public void setZipCode​(java.lang.String zipCode)
      Sets the zipCode
      Parameters:
      zipCode - address field
    • getCity

      public java.lang.String getCity()
      Returns the city name
      Returns:
      city
    • setCity

      public void setCity​(java.lang.String city)
      Sets the city name
      Parameters:
      city - address field
    • getCountry

      public java.lang.String getCountry()
      Returns the country name
      Returns:
      country
    • setCountry

      public void setCountry​(java.lang.String country)
      Sets the country
      Parameters:
      country - address field
    • getSalutation

      public java.lang.String getSalutation()
      Returns salutation for letters
      Returns:
      salutation
    • setSalutation

      public void setSalutation​(java.lang.String salutation)
      Sets the salutation for letters
      Parameters:
      salutation - address field
    • toDto

      public AddressDto toDto()
      Returns a corresponding data transfer object for this Address
      Returns:
      dto
    • fromDto

      public void fromDto​(AddressDto dto)
      Updates this entity from the given data transfer object
      Parameters:
      dto - source data transfer object to copy data from into this instance
    • toString

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