Companion

object Companion

Contains static declarations for the NotEmptyMap type.

Functions

Link copied to clipboard
@ExperimentalSince(version = KotoolsTypesVersion.V4_5_0)
fun <K, V> create(map: Map<K, V>): NotEmptyMap<K, V>

Creates a NotEmptyMap containing all the entries of the specified map, or throws an IllegalArgumentException if the map is empty.

Link copied to clipboard
@ExperimentalSince(version = KotoolsTypesVersion.V4_5_0)
fun <K, V> createOrNull(map: Map<K, V>): NotEmptyMap<K, V>?

Creates a NotEmptyMap containing all the entries of the specified map, or returns null if the map is empty.

Link copied to clipboard
@ExperimentalSince(version = KotoolsTypesVersion.V4_5_0)
fun <K, V> of(head: Pair<K, V>, vararg tail: Pair<K, V>): NotEmptyMap<K, V>

Creates a NotEmptyMap starting with the head and containing all the entries of the optional tail.