io.github.serpro69.kfaker.provider.Opera.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.provider
import io.github.serpro69.kfaker.*
import io.github.serpro69.kfaker.dictionary.*
import io.github.serpro69.kfaker.provider.unique.LocalUniqueDataProvider
import io.github.serpro69.kfaker.provider.unique.UniqueProviderDelegate
/**
* [FakeDataProvider] implementation for [YamlCategory.OPERA] category.
*/
@Suppress("unused")
class Opera internal constructor(fakerService: FakerService) : YamlFakeDataProvider(fakerService) {
override val yamlCategory = YamlCategory.OPERA
override val localUniqueDataProvider = LocalUniqueDataProvider()
override val unique by UniqueProviderDelegate(localUniqueDataProvider)
init {
fakerService.load(yamlCategory)
}
val italian = ItalianOpera(fakerService)
val german = GermanOpera(fakerService)
val french = FrenchOpera(fakerService)
// TODO: 24.11.2019 fun italian() // resolves to a random italian opera
// TODO: fun german() // resolves to a random german opera
// TODO: fun french() // resolves to a random french opera
}
class ItalianOpera internal constructor(
fakerService: FakerService
) : YamlFakeDataProvider(fakerService) {
override val yamlCategory = YamlCategory.OPERA
override val localUniqueDataProvider = LocalUniqueDataProvider()
override val unique by UniqueProviderDelegate(localUniqueDataProvider)
init {
fakerService.load(yamlCategory)
}
fun byGiuseppeVerdi() = resolve("italian", "by_giuseppe_verdi")
fun byGioacchinoRossini() = resolve("italian", "by_gioacchino_rossini")
fun byGaetanoDonizetti() = resolve("italian", "by_gaetano_donizetti")
fun byVincenzoBellini() = resolve("italian", "by_vincenzo_bellini")
fun byChristophWillibaldGluck() = resolve("italian", "by_christoph_willibald_gluck")
fun byWolfgangAmadeusMozart() = resolve("by_wolfgang_amadeus_mozart")
}
class GermanOpera internal constructor(
fakerService: FakerService
) : YamlFakeDataProvider(fakerService) {
override val yamlCategory = YamlCategory.OPERA
override val localUniqueDataProvider = LocalUniqueDataProvider()
override val unique by UniqueProviderDelegate(localUniqueDataProvider)
init {
fakerService.load(yamlCategory)
}
fun byWolfgangAmadeusMozart(): String = resolve("german", "by_wolfgang_amadeus_mozart")
fun byLudwigVanBeethoven(): String = resolve("german", "by_ludwig_van_beethoven")
fun byCarlMariaVonWeber(): String = resolve("german", "by_carl_maria_von_weber")
fun byRichardStrauss(): String = resolve("german", "by_richard_strauss")
fun byRichardWagner(): String = resolve("german", "by_richard_wagner")
fun byRobertSchumann(): String = resolve("german", "by_robert_schumann")
fun byFranzSchubert(): String = resolve("german", "by_franz_schubert")
fun byAlbanBerg(): String = resolve("german", "by_alban_berg")
}
class FrenchOpera internal constructor(
fakerService: FakerService
) : YamlFakeDataProvider(fakerService) {
override val yamlCategory = YamlCategory.OPERA
override val localUniqueDataProvider = LocalUniqueDataProvider()
override val unique by UniqueProviderDelegate(localUniqueDataProvider)
init {
fakerService.load(yamlCategory)
}
fun byChristophWillibaldGluck(): String = resolve("french", "by_christoph_willibald_gluck")
fun byMauriceRavel(): String = resolve("french", "by_maurice_ravel")
fun byHectorBerlioz(): String = resolve("french", "by_hector_berlioz")
fun byGeorgesBizet(): String = resolve("french", "by_georges_bizet")
fun byCharlesGounod(): String = resolve("french", "by_charles_gounod")
fun byCamilleSaintSaens(): String = resolve("french", "by_camille_saint_saëns")
}