Class Person

java.lang.Object
cz.cuni.kubinja.hospitalsystem.personnel.Person
All Implemented Interfaces:
Exportable
Direct Known Subclasses:
Doctor, Patient

public class Person extends Object implements Exportable
Represents generic person in hospital system.
  • Constructor Details

    • Person

      public Person(int id, String firstName, String lastName, LocalDate dateOfBirth)
      Creates person based on provided parameters.
      Parameters:
      id - unique identification number
      firstName - first name of person
      lastName - last name of person
      dateOfBirth - date of birth of person
    • Person

      public Person(int id, String firstName, String lastName, int day, int month, int year)
      Creates person based on provided parameters.
      Parameters:
      id - unique identification number
      firstName - first name of person
      lastName - last name of person
      day - day of birth
      month - month of birth
      year - year of birth
    • Person

      public Person(Person person)
      Creates new Person as a copy of provided Person.
      Parameters:
      person - Person that the constructor should copy.
    • Person

      public Person(int id, PersonData personData)
      Creates person based on id and data wrapper for rest of needed parameters.
      Parameters:
      id - Identification number of the person.
      personData - Data wrapper for the data needed for person creation.
  • Method Details

    • getId

      public int getId()
      Provides unique identification number of person
      Returns:
      Unique identification number
    • getFirstName

      public String getFirstName()
      Returns firstname of person.
      Returns:
      firstname of person.
    • getLastName

      public String getLastName()
      Returns lastname of person.
      Returns:
      lastname of person.
    • getDateOfBirth

      public LocalDate getDateOfBirth()
      Returns date of birth of person
      Returns:
      LocalDate object representing date of birth of person
    • getAge

      public int getAge()
      Returns age of the person.
      Returns:
      age of the person.
    • getClassIdentifier

      public static String getClassIdentifier()
      Returns custom identifier for Person class.
      Returns:
      custom identifier for Person class.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • export

      public String export()
      Description copied from interface: Exportable
      Text format that will be used for exporting object.
      Specified by:
      export in interface Exportable
      Returns:
      text that will be used for exporting object.