001/* 002 * Copyright © 2025 CUI-OpenSource-Software (info@cuioss.de) 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package de.cuioss.test.generator.domain; 017 018import de.cuioss.test.generator.TypedGenerator; 019 020import static de.cuioss.test.generator.Generators.fixedValues; 021 022/** 023 * Generates typical German street names for test data generation. 024 * 025 * <p>Available street names:</p> 026 * <ul> 027 * <li>Hauptstraße</li> 028 * <li>Bahnhofstraße</li> 029 * <li>Brunnenweg</li> 030 * <li>Schlossallee</li> 031 * <li>Altrottstrasse</li> 032 * <li>Parkweg</li> 033 * <li>Paradeplatz</li> 034 * </ul> 035 * 036 * <p><em>Example usage:</em></p> 037 * <pre> 038 * var generator = new StreetNameGenerator(); 039 * String streetName = generator.next(); // Returns one of the predefined street names 040 * </pre> 041 * 042 * <p>This generator is primarily used by {@link StreetGenerator} to create complete addresses.</p> 043 * 044 * @author Oliver Wolff 045 * @see StreetGenerator 046 */ 047public class StreetNameGenerator implements TypedGenerator<String> { 048 049 private final TypedGenerator<String> streets = fixedValues("Hauptstraße", "Bahnhofstraße", "Brunnenweg", 050 "Schlossallee", "Altrottstrasse", "Parkweg", "Paradeplatz"); 051 052 @Override 053 public String next() { 054 return streets.next(); 055 } 056 057 @Override 058 public Class<String> getType() { 059 return String.class; 060 } 061}