java.lang.Object
de.powerstat.validation.entities.Person
All Implemented Interfaces:
IEntity, Comparable<Person>

public final class Person extends Object implements Comparable<Person>, IEntity
Person. DSGVO relevant. TODO birth place (optional) TODO death place (optional) TODO history of citizenships TODO Identity card number at different times TODO eye color TODO Skin color TODO body height at different times (24cm - 272cm) TODO body weight at different times (212g - 635kg) TODO body temperature at different times TODO characteristics TODO Zahnstatus at differet times TODO DNA TODO faceid, fingerid, eyeid at different times TODO Signature(s) TODO Namenszusätze: Adelstitel, Academic title since, Work titles/qualifications since TODO ... Nicknames at different times TODO Address(es) at different times TODO Communication typ(s) at different times TODO photo(s) at different times TODO voice recordings at different times TODO ? marriage(s) / divorce(s) at different times TODO relationship(s), children, parents, siblings, ... at different times TODO languages (reading, writing, speeking, understanding, level) since TODO ownership at different times TODO knowledge since TODO get vcard ? TODO Change DateTime of an entry to an earlier entry
  • Field Details

    • LOGGER

      private static final org.apache.logging.log4j.Logger LOGGER
      Logger.
    • uuid

      private final UUID uuid
      Universally Unique Identifier.
    • lastname

      private final HistoryOf<Lastname> lastname
      Lastnames at different times.
    • sex

      private final HistoryOf<Gender> sex
      Gender/sex at different times.
    • firstnames

      private final HistoryOf<List<Firstname>> firstnames
      First names at different times.
    • callname

      private final HistoryOf<Integer> callname
      Call name at different times.
    • birthday

      private Optional<OffsetDateTime> birthday
      Birthday if known with time or 00:00:00.
    • deathdate

      private Optional<OffsetDateTime> deathdate
      Death date if not still alive, with time or 00:00:00.
    • bloodGroup

      private Optional<BloodGroup> bloodGroup
      Blood group.
  • Constructor Details

    • Person

      private Person()
      Private default constructor.
  • Method Details

    • of

      public static Person of()
      Person factory.
      Returns:
      Person object
    • of

      public static Person of(Lastname lastname, Gender gender)
      Person factory.
      Parameters:
      lastname - Lastname
      gender - Gender
      Returns:
      Person object
    • of

      public static Person of(Lastname lastname, Gender gender, List<Firstname> firstnames)
      Person factory.
      Parameters:
      lastname - Lastname
      gender - Gender
      firstnames - Firstnames
      Returns:
      Person object
    • of

      public static Person of(Lastname lastname, Gender gender, List<Firstname> firstnames, OffsetDateTime birthdate)
      Person factory.
      Parameters:
      lastname - Lastname
      gender - Gender
      firstnames - Firstnames
      birthdate - Birthdate
      Returns:
      Person object
    • stringValue

      public String stringValue()
      Returns the value of this Person as a string.
      Specified by:
      stringValue in interface IEntity
      Returns:
      The text value represented by this object after conversion to type string (lastname, firstnames).
    • hashCode

      public int hashCode()
      Calculate hash code.
      Overrides:
      hashCode in class Object
      Returns:
      Hash
      See Also:
    • equals

      public boolean equals(Object obj)
      Is equal with another object.
      Overrides:
      equals in class Object
      Parameters:
      obj - Object
      Returns:
      true when equal, false otherwise
      See Also:
    • toString

      public String toString()
      Returns the string representation of this Person. The exact details of this representation are unspecified and subject to change, but the following may be regarded as typical: "Person[person=]"
      Overrides:
      toString in class Object
      Returns:
      String representation of this Person
      See Also:
    • getFirstnames

      private static String getFirstnames(HistoryOf<List<Firstname>> firstnames)
      Get firstnames as string.
      Parameters:
      firstnames - Firstnames
      Returns:
      Firstnames as string
    • compareTo

      public int compareTo(Person obj)
      Compare with another object.
      Specified by:
      compareTo in interface Comparable<Person>
      Parameters:
      obj - Object to compare with
      Returns:
      0: equal; 1: greater; -1: smaller
      See Also:
    • getLastnameAtBirth

      public Lastname getLastnameAtBirth()
      Get lastname at birth.
      Returns:
      First known lastname
    • getLastnameActual

      public Lastname getLastnameActual()
      Get actual lastname.
      Returns:
      Last known lastname
    • getLastnamePrevious

      public Lastname getLastnamePrevious()
      Get previous lastname.
      Returns:
      Previous lastname or actual lastname/lastname at birth
    • addLastname

      public void addLastname(OffsetDateTime since, Lastname name)
      Add lastname.
      Parameters:
      since - Since datetime
      name - Lastname
      Throws:
      NullPointerException - If since and/or lastname is/are null
      IndexOutOfBoundsException - If since lies in the future
      IllegalArgumentException - If lastname is larger than 40 characters or includes illegal characters
    • getGenderAtBirth

      public Gender getGenderAtBirth()
      Get gender at birth.
      Returns:
      First known gender
    • getGenderActual

      public Gender getGenderActual()
      Get actual gender.
      Returns:
      Last known gender
    • getGenderPrevious

      public Gender getGenderPrevious()
      Get previous gender.
      Returns:
      Previous gender or actual gender/gender at birth
    • addGender

      public void addGender(OffsetDateTime since, Gender gender)
      Add gender.
      Parameters:
      since - Since datetime
      gender - Gender
      Throws:
      IndexOutOfBoundsException - If since lies in the future
    • getFirstnamesAtBirth

      public List<Firstname> getFirstnamesAtBirth()
      Get firstnames at birth.
      Returns:
      List og first known firstnames
    • getFirstnamesActual

      public List<Firstname> getFirstnamesActual()
      Get actual firstnames.
      Returns:
      List pf last known firstnames
    • getFirstnamesPrevious

      public List<Firstname> getFirstnamesPrevious()
      Get previous firstnames.
      Returns:
      Previous firstnames or actual firstnames/firstnames at birth
    • addFirstnames

      public void addFirstnames(OffsetDateTime since, List<Firstname> names)
      Add firstnames.
      Parameters:
      since - Since datetime
      names - Firstnames
      Throws:
      NullPointerException - If since and/or firstnames is/are null
      IndexOutOfBoundsException - If since lies in the future
      IllegalArgumentException - If firstnames is larger than 32 characters or includes illegal characters
    • setBirthday

      public void setBirthday(OffsetDateTime date)
      Set birthday.
      Parameters:
      date - Birthday date with 00:00:00 or with exact birth time or null.
    • getBirthday

      public Optional<OffsetDateTime> getBirthday()
      Get birthday.
      Returns:
      Optional OffsetDateTime
    • setDeathdate

      public void setDeathdate(OffsetDateTime date)
      Set death date.
      Parameters:
      date - Death date date with 00:00:00 or with exact death time or null.
      Throws:
      IllegalArgumentException - If birthday > death date
    • getDeathdate

      public Optional<OffsetDateTime> getDeathdate()
      Get death date.
      Returns:
      Optional OffsetDateTime
    • setBloodGroup

      public void setBloodGroup(BloodGroup bloodGroup)
      Set blood group.
      Parameters:
      bloodGroup - Blood group
    • getBloodGroup

      public Optional<BloodGroup> getBloodGroup()
      Get blood group.
      Returns:
      Optional BloodGroup