aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firm/EnumRenderer.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/moe/nea/firm/EnumRenderer.kt')
-rw-r--r--src/main/kotlin/moe/nea/firm/EnumRenderer.kt13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/kotlin/moe/nea/firm/EnumRenderer.kt b/src/main/kotlin/moe/nea/firm/EnumRenderer.kt
new file mode 100644
index 0000000..3ffd6d3
--- /dev/null
+++ b/src/main/kotlin/moe/nea/firm/EnumRenderer.kt
@@ -0,0 +1,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()
+ }
+
+ }
+ }
+} \ No newline at end of file