io.github.serpro69.kfaker.dictionary.Category.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
/**
* A generic data category of a given [name]
*
* @property name the name of this data category
*/
interface Category {
val name: String
companion object {
/**
* Creates a new [Category] with the given [name].
*/
internal fun ofName(name: String): Category = object : Category {
override val name: String = name.uppercase()
}
}
}
/**
* Returns the lowercase [Category.name] as string.
*/
internal fun Category.lowercase(): String = name.lowercase()