Package de.cuioss.test.generator.domain
Enum Class NameGenerators
- All Implemented Interfaces:
Serializable,Comparable<NameGenerators>,Constable
Provides a collection of name generators for testing purposes.
Includes both German and English names, separated by gender and usage context.
Available generators for German names:
FIRSTNAMES_MALE_GERMAN- Top 10 male names in Germany (2014)FIRSTNAMES_FEMALE_GERMAN- Top 10 female names in Germany (2014)FIRSTNAMES_ANY_GERMAN- Combined German namesFAMILY_NAMES_GERMAN- Top 10 German family names
Available generators for English names:
FIRSTNAMES_MALE_ENGLISH- Top 10 male names in US (2014)FIRSTNAMES_FEMALE_ENGLISH- Top 10 female names in US (2014)FIRSTNAMES_ANY_ENGLISH- Combined English namesFAMILY_NAMES_ENGLISH- Top 10 US family names
Special generators:
UNIT_TESTS- Technical string generator for unit testing
Example usage:
TypedGenerator<String> generator = NameGenerators.FIRSTNAMES_MALE_ENGLISH.generator();
String name = generator.next(); // Returns a common English male first name
- Author:
- Oliver Wolff
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionTop 10 family names from U.S.Top 10 German family names from WikipediaCombined set of male and female English namesCombined set of male and female German namesTop 10 female names in US (2014)Top 10 female names in Germany (2014)Top 10 male names in US (2014)Top 10 male names in Germany (2014)Technical string generator for unit testing. -
Method Summary
Modifier and TypeMethodDescriptionProvides access to the underlying name generator.static NameGeneratorsReturns the enum constant of this class with the specified name.static NameGenerators[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FIRSTNAMES_MALE_GERMAN
Top 10 male names in Germany (2014) -
FIRSTNAMES_FEMALE_GERMAN
Top 10 female names in Germany (2014) -
FIRSTNAMES_ANY_GERMAN
Combined set of male and female German names -
FAMILY_NAMES_GERMAN
Top 10 German family names from Wikipedia -
FIRSTNAMES_MALE_ENGLISH
Top 10 male names in US (2014) -
FIRSTNAMES_FEMALE_ENGLISH
Top 10 female names in US (2014) -
FIRSTNAMES_ANY_ENGLISH
Combined set of male and female English names -
FAMILY_NAMES_ENGLISH
Top 10 family names from U.S. Census Bureau -
UNIT_TESTS
Technical string generator for unit testing. Generates random strings between 1 and 256 characters.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
generator
Provides access to the underlying name generator.- Returns:
- A
TypedGeneratorthat generates names according to the enum constant's specification
-