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 names of major German cities for testing purposes.
024 * Provides a fixed set of well-known cities, primarily from southern Germany.
025 * 
026 * <p>Available cities:</p>
027 * <ul>
028 *   <li>Heidelberg</li>
029 *   <li>Walldorf</li>
030 *   <li>Mannheim</li>
031 *   <li>Stuttgart</li>
032 *   <li>Karlsruhe</li>
033 *   <li>Berlin</li>
034 *   <li>Freiburg</li>
035 *   <li>Hamburg</li>
036 *   <li>München</li>
037 * </ul>
038 * 
039 * <p><em>Example usage:</em></p>
040 * <pre>
041 * var generator = new CityGenerator();
042 * String city = generator.next(); // Returns one of the predefined German cities
043 * </pre>
044 *
045 * @author Oliver Wolff
046 */
047public class CityGenerator implements TypedGenerator<String> {
048
049    private final TypedGenerator<String> cities = fixedValues("Heidelberg", "Walldorf", "Mannheim", "Stuttgart",
050            "Karlsruhe", "Berlin", "Freiburg", "Hamburg", "München");
051
052    @Override
053    public String next() {
054        return cities.next();
055    }
056
057    @Override
058    public Class<String> getType() {
059        return String.class;
060    }
061}