toString
Returns the string representation of this map.
This function should behave like calling the Any.toString function on a Map with keys of type K and values of type V.
Calling from Kotlin
Here's an example of calling this function from Kotlin code:
val notEmptyMap: NotEmptyMap<Char, Int> =
notEmptyMapOf('a' to 1, 'b' to 2, 'c' to 3)
assertEquals(expected = "{a=1, b=2, c=3}", actual = "$notEmptyMap")
val map: Map<Char, Int> = notEmptyMap.toMap()
assertEquals(expected = "$map", actual = "$notEmptyMap")
Content copied to clipboard