Class People

java.lang.Object
io.bloviate.datafaker.People

public final class People extends Object
Builds a RowContext of coherent Person identities for correlated person columns (issue #473). For each row a name is drawn from Datafaker, and the email, username, and full name are derived from that name, so the columns agree.
RowContext<Person> person = People.context(seed, Locale.ENGLISH);
Set.of(
    new ColumnConfiguration("first_name", person.project(Person::firstName)),
    new ColumnConfiguration("last_name",  person.project(Person::lastName)),
    new ColumnConfiguration("full_name",  person.project(Person::fullName)),
    new ColumnConfiguration("email",      person.project(Person::email)),
    new ColumnConfiguration("username",   person.project(Person::username)));

The identity is a pure function of (seed, rowIndex) (mixed with splitmix64), so the data is reproducible and order-independent under parallel/partitioned fills. Email and username carry a row-index suffix (jane.doe42@example.com) so they are unique even at large row counts while still reading as derived from the name; the domain is the reserved example.com.

Since:
2.12.0
See Also:
  • Method Details

    • context

      public static RowContext<Person> context(long seed, Locale locale)
      A context of coherent Person identities.
      Parameters:
      seed - the group seed; vary it for a different (still reproducible) set of identities
      locale - the locale for names (fixed for cross-machine reproducibility)
      Returns:
      a row context wireable via RowContext.project(Function)