toMap
Returns all entries of this map as a Map with keys of type K and values of type V.
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)
val map: Map<Char, Int> = notEmptyMap.toMap()
assertEquals(expected = "{a=1, b=2, c=3}", actual = "$map")
Content copied to clipboard