aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firm/EnumRenderer.kt
blob: 3ffd6d31973e924bf9be60b22bed39f85354e75e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
package moe.nea.firm

interface EnumRenderer<E: Any> {
	fun getName(option: ManagedOption<E>, value: E): String
	companion object {
		fun <E: Enum<E>> default() = object: EnumRenderer<E> {
			override fun getName(option: ManagedOption<E>, value: E): String {
				return value.name.lowercase()
			}

		}
	}
}