encodeToMap

inline fun <T> Properties.encodeToMap(value: T): Map<String, Any>

Encodes properties from given value to a map using serializer for reified type T and returns this map. null values are omitted from the output.