toMap

fun <T : Any> T.toMap(vararg excludeKeys: String): Map<String, Any?>

Converts a data class object to a map, where keys are property names (or values from @MapKey annotation), and values are the property values.

Return

Map representing the object.

Parameters

excludeKeys

Keys to exclude from the resulting map