corda / net.corda.core.utilities / NonEmptySet

NonEmptySet

class NonEmptySet<T> : Set<T>

An immutable ordered non-empty set.

Functions

equals

fun equals(other: Any?): Boolean

forEach

fun forEach(action: Consumer<in T>): Unit

hashCode

fun hashCode(): Int

head

Returns the first element of the set.

fun head(): T

isEmpty

fun isEmpty(): Boolean

iterator

fun iterator(): Iterator<T>

parallelStream

fun parallelStream(): Stream<T>

spliterator

fun spliterator(): Spliterator<T>

stream

fun stream(): Stream<T>

toString

fun toString(): String

Companion Object Functions

copyOf

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

fun <T> copyOf(elements: Collection<T>): NonEmptySet<T>

of

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(element: T): NonEmptySet<T>

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

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