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; 019import lombok.AccessLevel; 020import lombok.RequiredArgsConstructor; 021 022import java.util.List; 023 024import static de.cuioss.test.generator.Generators.fixedValues; 025import static de.cuioss.test.generator.Generators.strings; 026 027/** 028 * Provides generators for organization names, including well-known fictional companies. 029 * 030 * <p>Available generators:</p> 031 * <ul> 032 * <li>{@link #READABLE} - Names of famous fictional companies from various media sources</li> 033 * <li>{@link #UNIT_TESTS} - Technical string generator for unit testing</li> 034 * </ul> 035 * 036 * <p><em>Example usage:</em></p> 037 * <pre> 038 * {@code TypedGenerator<String> generator = OrganizationNameGenerator.READABLE.generator();} 039 * String company = generator.next(); // Returns names like "Acme Corp.", "Stark Industries", etc. 040 * </pre> 041 * 042 * @author Oliver Wolff 043 */ 044@RequiredArgsConstructor(access = AccessLevel.PRIVATE) 045public enum OrganizationNameGenerator { 046 047 /** 048 * The 25 largest fictional companies from popular culture. 049 * Includes companies from literature, movies, TV shows, and comics. 050 * Examples: Acme Corp., Stark Industries, Wayne Enterprises 051 */ 052 READABLE(fixedValues(List.of("CHOAM", "Acme Corp.", "Sirius Cybernetics Corp.", "MomCorp", "Rich Industries", 053 "Soylent Corp.", "Very Big Corp. of America", "Frobozz Magic Co.", "Warbucks Industries", "Tyrell Corp.", 054 "Wayne Enterprises", "Virtucon", "Globex", "Umbrella Corp.", "Wonka Industries", "Stark Industries", 055 "Clampett Oil", "Oceanic Airlines", "Yoyodyne Propulsion Sys.", "Cyberdyne Systems Corp.", 056 "d'Anconia Copper", "Gringotts", "Oscorp", "Nakatomi Trading Corp.", "Spacely Space Sprockets"))), 057 058 /** 059 * Technical string generator for unit testing. 060 * Generates random strings between 1 and 256 characters. 061 */ 062 UNIT_TESTS(strings(1, 256)); 063 064 private final TypedGenerator<String> generator; 065 066 /** 067 * Provides access to the underlying organization name generator. 068 * 069 * @return A {@link TypedGenerator} that generates organization names according to the enum constant's specification 070 */ 071 public TypedGenerator<String> generator() { 072 return generator; 073 } 074}