Companion

object Companion

Contains static declarations for the NotEmptySet type.

Functions

Link copied to clipboard
@ExperimentalSince(version = KotoolsTypesVersion.V4_5_0)
fun <E> create(collection: Collection<E>): NotEmptySet<E>

Creates a NotEmptySet containing all the elements of the specified collection, or throws an IllegalArgumentException if the collection is empty.

Link copied to clipboard
@ExperimentalSince(version = KotoolsTypesVersion.V4_5_0)
fun <E> createOrNull(collection: Collection<E>): NotEmptySet<E>?

Creates a NotEmptySet containing all the elements of the specified collection, or returns null if the collection is empty.

Link copied to clipboard
@ExperimentalSince(version = KotoolsTypesVersion.V4_5_0)
fun <E> of(head: E, vararg tail: E): NotEmptySet<E>

Creates a NotEmptySet starting with a head and containing all the elements of the optional tail.