Class PersonFactory
java.lang.Object
org.episteme.social.sociology.PersonFactory
Factory for creating
Person instances with auto-generated unique identifiers.
Provides support for different ID generation strategies (UUID, SSN) via pluggable IdGenerator.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a factory with the default UUID generator.PersonFactory(IdGenerator idGenerator) Creates a factory with a specific ID generator. -
Method Summary
Modifier and TypeMethodDescriptionCreates a person with minimal information (name only).Creates a person with specific attributes and an auto-generated ID.static PersonFactorywithSSN()Creates a factory instance configured to generate SSN-style IDs.static PersonFactorywithUUID()Creates a factory instance configured to generate UUIDs.
-
Constructor Details
-
PersonFactory
public PersonFactory()Creates a factory with the default UUID generator. -
PersonFactory
Creates a factory with a specific ID generator.- Parameters:
idGenerator- the generator to use for person IDs
-
-
Method Details
-
create
Creates a person with specific attributes and an auto-generated ID.- Parameters:
name- the person's namegender- the person's genderbirthDate- the person's birth datenationality- the person's nationality- Returns:
- a new Person instance
-
create
-
withSSN
Creates a factory instance configured to generate SSN-style IDs.- Returns:
- a new PersonFactory
-
withUUID
Creates a factory instance configured to generate UUIDs.- Returns:
- a new PersonFactory
-