I have an Enum class like
enum class Definition(
val definitionName: String,
val parameters: Map<String, String>,
val definitionPath: String = "com/1.0"
) {
APPLE(
"this-is-an-apple",
mapOf("1" to "2")
),
BANANA(
"this-is-banana",
mapOf("3" to "4")
)
}
I would like to construct maps for each enum without specifying the keys and values, like for APPLE
mapOf("definition" to "this-is-an-apple",
"parameters" to mapOf("1" to "2"),
"definitionPath" to "com/1.0"
)