Package de.cuioss.test.generator.domain
Class FullNameGenerator
java.lang.Object
de.cuioss.test.generator.domain.FullNameGenerator
- All Implemented Interfaces:
TypedGenerator<String>
Generates full names in the format 'firstname lastname' based on the specified locale.
Supports both German and English name sets.
Name sources:
- German names from
NameGenerators.FIRSTNAMES_ANY_GERMANandNameGenerators.FAMILY_NAMES_GERMAN - English names from
NameGenerators.FIRSTNAMES_ANY_ENGLISHandNameGenerators.FAMILY_NAMES_ENGLISH
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 Summary
ConstructorsConstructorDescriptionCreates a new FullNameGenerator with the default locale (English).FullNameGenerator(Locale locale) Creates a new FullNameGenerator for the specified locale. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.cuioss.test.generator.TypedGenerator
getType
-
Constructor Details
-
FullNameGenerator
public FullNameGenerator()Creates a new FullNameGenerator with the default locale (English). -
FullNameGenerator
Creates a new FullNameGenerator for the specified locale.- Parameters:
locale- Determines the name set to use. IfLocale.GERMAN, German names will be used; for all other locales, English names will be used.
-
-
Method Details
-
next
Description copied from interface:TypedGeneratorGenerates the next instance based on the generator's configuration. Implementations must ensure thread-safety.- Specified by:
nextin interfaceTypedGenerator<String>- Returns:
- A newly created instance. May be null if the generator explicitly supports null value generation.
-