Class Person

All Implemented Interfaces:
ILightObject, Serializable
Direct Known Subclasses:
PersonExt, Student, Teacher

public class Person extends AbstractLightObject
Since:
1.0 Nov 30, 2007, 0.0.4-SNAPSHOT
Version:
%I%, %G%
Author:
Steph GAUDRY
See Also:
Serialized Form
  • Field Details

  • Constructor Details

    • Person

      public Person()
    • Person

      public Person(int id, String lastName)
      Parameters:
      id -
      lastName -
    • Person

      public Person(String lastName, String firstName)
      Create a person with only a lastName and a firstName. Person id has -1 value
      Parameters:
      lastName -
      firstName -
  • Method Details

    • getId

      public int getId()
      Description copied from interface: ILightObject
      Identifier of the ILightObject
      Returns:
      the id
    • setId

      public void setId(int id)
      Parameters:
      id - the id to set
      See Also:
      ILightObject.getId()
    • copy

      public void copy(Person p)
    • getDisplay

      public String getDisplay()
      Returns a String with the last name and the first name.
      Returns:
      the display
    • setDisplay

      public void setDisplay(String display)
      Sets the last name by calling the setLastName(String) method.
      Parameters:
      display - String representation of the object
      See Also:
      Person(int, String)
    • equals

      public boolean equals(Object obj)
      Indicates whether some other object is "equal to" this person. \nCheck is done on following fields :
      Overrides:
      equals in class AbstractLightObject
      Parameters:
      obj - the reference object with which to compare.
      Returns:
      true if this person is the same as the obj argument; false otherwise.
      See Also:
      Object.equals(java.lang.Object), hashCode()
    • hashCode

      public int hashCode()
      Returns a hash code value for the person.
      Hash is done on following fields :
      Overrides:
      hashCode in class AbstractLightObject
      Returns:
      a hash code value for this person.
      See Also:
      Object.hashCode(), equals(Object)
    • toString

      public String toString()
      Description copied from class: AbstractLightObject
      Builds a string with variables values and the class.
      Overrides:
      toString in class AbstractLightObject
      Returns:
      a String representation of this LightObject only for debugging
      See Also:
      Object.toString()
    • getBirthdate

      public Date getBirthdate()
    • getFirstName

      public String getFirstName()
    • getLastName

      public String getLastName()
    • getGender

      public EGender getGender()
    • setBirthdate

      public void setBirthdate(Date birthdate)
    • setFirstName

      public void setFirstName(String firstName)
    • setLastName

      public void setLastName(String lastName)
    • setGender

      public void setGender(EGender gender)