Class StreetNameGenerator

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

public class StreetNameGenerator extends Object implements TypedGenerator<String>
Generates typical German street names for test data generation.

Available street names:

  • Hauptstraße
  • Bahnhofstraße
  • Brunnenweg
  • Schlossallee
  • Altrottstrasse
  • Parkweg
  • Paradeplatz

Example usage:

 var generator = new StreetNameGenerator();
 String streetName = generator.next(); // Returns one of the predefined street names
 

This generator is primarily used by StreetGenerator to create complete addresses.

Author:
Oliver Wolff
See Also:
  • Constructor Details

  • 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.
    • getType

      public Class<String> getType()
      Description copied from interface: TypedGenerator
      Provides type information about what kind of objects this generator creates. The default implementation uses the first non-null result from TypedGenerator.next() to determine the type.

      Note: If your generator may return null values or the generated type differs from the actual instance type, you should override this method.

      Specified by:
      getType in interface TypedGenerator<String>
      Returns:
      The class information indicating which type this generator is responsible for.