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

fun head(): T

Returns the first element of the set.

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

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.

of

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.

Extension Functions

contextLogger

fun Any.contextLogger(): Logger

When called from a companion object, returns the logger for the enclosing class.

expectEvents

fun <E : Any> Iterable<E>.expectEvents(isStrict: Boolean = true, expectCompose: () -> ExpectCompose<E>): Unit

Run the specified DSL against the event Iterable.

toNonEmptySet

fun <T> Collection<T>.toNonEmptySet(): NonEmptySet<T>