io.github.serpro69.kfaker.dictionary.YamlCategory.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-faker Show documentation
Show all versions of kotlin-faker Show documentation
https://github.com/serpro69/kotlin-faker
package io.github.serpro69.kfaker.dictionary
import java.util.NoSuchElementException
/**
* This enum contains all default categories and matches with the names of the .yml files for 'en' locale.
*
* If any new category is added to .yml file(s) a new class has to be added to this enum as well.
*/
internal enum class YamlCategory : Category {
// Special providers for locale-based symbols
SEPARATOR,
CURRENCY_SYMBOL,
// Rest of providers
ADDRESS,
ADJECTIVE,
ANCIENT,
APP,
APPLIANCE,
AQUA_TEEN_HUNGER_FORCE,
ARTIST,
AUSTRALIA,
BACK_TO_THE_FUTURE,
BANK,
BARCODE,
BASKETBALL,
BEER,
BIBLE,
BIG_BANG_THEORY,
BLOOD,
BOJACK_HORSEMAN,
BOOK,
BOOKS,
BOSSA_NOVA,
BREAKING_BAD,
BROOKLYN_NINE_NINE,
BUFFY,
BUSINESS,
CAMERA,
CANNABIS,
CELL_PHONE,
CHIQUITO,
CHUCK_NORRIS,
CODE,
COFFEE,
COIN,
COLOR,
COMMERCE,
COMMUNITY,
COMPANY,
COMPASS,
COMPUTER,
CONAN,
CONSTRUCTION,
COSMERE,
COUNTRY_CODE,
CREATURE,
CROSSFIT,
CRYPTO_COIN,
CULTURE_SERIES,
CURRENCY,
DC_COMICS,
DEMOGRAPHIC,
DEPARTED,
DESSERT,
DEVICE,
DND,
DORAEMON,
GAMES,
DRAGON_BALL,
DRIVING_LICENSE,
DRONE,
DR_WHO,
DUMB_AND_DUMBER,
DUNE,
EDUCATOR,
ELECTRICAL_COMPONENTS,
EMOTION,
ESPORT,
FAMILY_GUY,
FILE,
FINAL_SPACE,
FINANCE,
FMA_BROTHERHOOD,
FOOD,
FOOTBALL,
FRIENDS,
FUNNY_NAME,
FUTURAMA,
GAME,
GAME_OF_THRONES,
GENDER,
GHOSTBUSTERS,
GRATEFUL_DEAD,
GREEK_PHILOSOPHERS,
HACKER,
HACKERS,
HARRY_POTTER,
HEROES,
HEROES_OF_THE_STORM,
HEY_ARNOLD,
HIPSTER,
HITCHHIKERS_GUIDE_TO_THE_GALAXY,
HOBBIT,
HOBBY,
HOUSE,
HOW_I_MET_YOUR_MOTHER,
HOW_TO_TRAIN_YOUR_DRAGON,
ID_NUMBER,
INDUSTRY_SEGMENTS,
INTERNET,
INVOICE,
JOB,
KAMEN_RIDER,
KPOP,
LEBOWSKI,
LORD_OF_THE_RINGS,
LOREM,
LOVECRAFT,
MARKDOWN,
MARKETING,
MEASUREMENT,
MICHAEL_SCOTT,
MILITARY,
MONEY,
MOUNTAIN,
MOUNTAINEERING,
MOVIE,
MUSIC,
NAME,
NARUTO,
NATION,
NATO_PHONETIC_ALPHABET,
NEW_GIRL,
ONE_PIECE,
OPERA,
PARKS_AND_REC,
PEARL_JAM,
PHISH,
PHONE_NUMBER,
PRINCE,
PRINCESS_BRIDE,
PROGRAMMING_LANGUAGE,
QUOTE,
RAJNIKANTH,
RELATIONSHIP,
RESTAURANT,
RICK_AND_MORTY,
ROCK_BAND,
ROOM,
RUPAUL,
RUSH,
SCIENCE,
SEINFELD,
SHAKESPEARE,
SHOW,
SILICON_VALLEY,
SIMPSONS,
SLACK_EMOJI,
SOURCE,
SOUTH_PARK,
SPACE,
SPORT,
STARGATE,
STAR_TREK,
STAR_WARS,
STRANGER_THINGS,
STRIPE,
STUDIO_GHIBLI,
SUBSCRIPTION,
SUITS,
SUPERHERO,
SUPERNATURAL,
SWORD_ART_ONLINE,
TARKOV,
TEA,
TEAM,
THE_EXPANSE,
FRESH_PRINCE_OF_BEL_AIR,
THE_IT_CROWD,
THE_OFFICE,
THE_THICK_OF_IT,
TOLKIEN,
TRON,
TWIN_PEAKS,
UMPHREYS_MCGEE,
UNIVERSITY,
VEHICLE,
VENTURE_BROS,
VERBS,
VOLLEYBALL,
V_FOR_VENDETTA,
WORLD_CUP,
YODA,
;
companion object {
/**
* Returns [YamlCategory] by [name] string (case-insensitive).
*/
internal fun findByName(name: String): YamlCategory {
return values().firstOrNull { it.lowercase() == name.lowercase() }
?: throw NoSuchElementException("Category with name '$name' not found.")
}
}
}