Enums in Kotlin already have a name
property already defined (like Java). This is conflicting with your enum called name
. To fix it, you could capitalize it, which is more idiomatic:
enum class DeviceFieldQuery(val clazz: Class<*>) {
Id(Int::class.java),
Name(String::class.java),
}