Class PersonFactory

java.lang.Object
org.episteme.social.sociology.PersonFactory

public class PersonFactory extends Object
Factory for creating Person instances with auto-generated unique identifiers.

Provides support for different ID generation strategies (UUID, SSN) via pluggable IdGenerator.

* @version 1.1
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • PersonFactory

      public PersonFactory()
      Creates a factory with the default UUID generator.
    • PersonFactory

      public PersonFactory(IdGenerator idGenerator)
      Creates a factory with a specific ID generator.
      Parameters:
      idGenerator - the generator to use for person IDs
  • Method Details

    • create

      public Person create(String name, Gender gender, LocalDate birthDate, String nationality)
      Creates a person with specific attributes and an auto-generated ID.
      Parameters:
      name - the person's name
      gender - the person's gender
      birthDate - the person's birth date
      nationality - the person's nationality
      Returns:
      a new Person instance
    • create

      public Person create(String name)
      Creates a person with minimal information (name only). Defaults other fields to unspecified/null.
      Parameters:
      name - the person's name
      Returns:
      a new Person instance
    • withSSN

      public static PersonFactory withSSN()
      Creates a factory instance configured to generate SSN-style IDs.
      Returns:
      a new PersonFactory
    • withUUID

      public static PersonFactory withUUID()
      Creates a factory instance configured to generate UUIDs.
      Returns:
      a new PersonFactory