Companion

object Companion

Functions

Link copied to clipboard
fun <T> copyOf(elements: Collection<T>): NonEmptySet<T>

Returns a non-empty set containing each of elements, minus duplicates, in the order each appears first in the source collection.

Link copied to clipboard
fun <T> of(element: T): NonEmptySet<T>

Returns a singleton set containing element. This behaves the same as Collections.singleton but returns a NonEmptySet for the extra type-safety.

fun <T> of(first: T, second: T, vararg rest: T): NonEmptySet<T>

Returns a non-empty set containing the given elements, minus duplicates, in the order each was specified.