Class FullNameGenerator

java.lang.Object
de.cuioss.test.generator.domain.FullNameGenerator
All Implemented Interfaces:
TypedGenerator<String>

public class FullNameGenerator extends Object implements TypedGenerator<String>
Generates full names in the format 'firstname lastname' based on the specified locale. Supports both German and English name sets.

Name sources:

Example usage:

 // For German names
 var generator = new FullNameGenerator(Locale.GERMAN);
 String name = generator.next(); // e.g. "Hans Schmidt"
 
 // For English names
 generator = new FullNameGenerator(Locale.ENGLISH);
 name = generator.next(); // e.g. "John Smith"
 
Author:
Oliver Wolff
  • Constructor Details

    • FullNameGenerator

      Creates a new FullNameGenerator with the default locale (English).
    • FullNameGenerator

      public FullNameGenerator(Locale locale)
      Creates a new FullNameGenerator for the specified locale.
      Parameters:
      locale - Determines the name set to use. If Locale.GERMAN, German names will be used; for all other locales, English names will be used.
  • Method Details

    • next

      public String next()
      Description copied from interface: TypedGenerator
      Generates the next instance based on the generator's configuration. Implementations must ensure thread-safety.
      Specified by:
      next in interface TypedGenerator<String>
      Returns:
      A newly created instance. May be null if the generator explicitly supports null value generation.