All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.serpro69.kfaker.dictionary.Category.kt Maven / Gradle / Ivy

There is a newer version: 2.0.0-rc.7
Show newest version
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()





© 2015 - 2024 Weber Informatics LLC | Privacy Policy