// https://stackoverflow.com/questions/28548015/how-do-i-create-an-enum-from-a-string-in-kotlin inline fun > valueOf(type: String): T? { return try { java.lang.Enum.valueOf(T::class.java, type) } catch (e: Exception) { null } }