toString

open override fun toString(): String

Returns the string representation of this map.

This method should behave like calling the Map.toString method.


Calling from Kotlin

Here's an example of calling this method 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")