Klasse Person

java.lang.Object
application.model.Person

public class Person extends Object
Siehe auch:
  • Felddetails

  • Konstruktordetails

    • Person

      public Person()
      Create an empty person
    • Person

      public Person(String surname, String name, String misc, LocalDate birthday)
      Creates a new person with all attributes
      Parameter:
      surname - The surname of the person
      name - The name of the person
      misc - The middle name of the person of or everything if it could not get parsed properly
      birthday - the Birthday of the person
  • Methodendetails

    • parseFromCSVLine

      public static Person parseFromCSVLine(String line, int lineNumber) throws Person.PersonCouldNotBeParsedException
      Parsing lines in the format: birthday;name
      • the name is expected like this: name, surname, misc
      • the birthday is expected like this: dd.MM.yyyy

      The name and surname are mandatory

      Parameter:
      line - a read line from the file
      lineNumber - which line of the file is parsed right now
      Gibt zurück:
      a new Person resulting from the given String
      Löst aus:
      Person.PersonCouldNotBeParsedException
    • parseFromTXTLine

      public static Person parseFromTXTLine(String line, int lineNumber) throws Person.PersonCouldNotBeParsedException
      Parameter:
      line - a read line from the Text-file
      Gibt zurück:
      a new Person resulting from the given String
      Löst aus:
      Person.PersonCouldNotBeParsedException
    • getBirthday

      public LocalDate getBirthday()
      Gibt zurück:
      the birthday of the person
    • setBirthday

      public void setBirthday(LocalDate birthday)
      Parameter:
      birthday - the birthday to set
    • getMisc

      public String getMisc()
      Gibt zurück:
      the middle name / everything of the person
    • setMisc

      public void setMisc(String misc)
      Parameter:
      misc - the middle name to set
    • getName

      public String getName()
      Gibt zurück:
      the name of the person
    • setName

      public void setName(String name)
      Parameter:
      name - the name to set
    • getSurname

      public String getSurname()
      Gibt zurück:
      the surname of the person
    • setSurname

      public void setSurname(String surname)
      Parameter:
      surname - the surname to set
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • namesToString

      public String namesToString()
    • toTXTString

      public String toTXTString()
      String representation of the person with the format:
      name misc surname=dd.mm.yyyy
      Gibt zurück:
      The String representation of the person for a TXT-file.
    • toCSVString

      public String toCSVString()
      Gibt zurück:
      a CSV-String representation of the person.
    • toExtendedString

      public String toExtendedString()
      Gibt zurück:
      a ExtendedString of the person for Debugging