NotEmptySet

@Serializable(with = NotEmptySetSerializer::class)
class NotEmptySet<out E> : Set<E>

Representation of sets that contain at least one element.

Parameters

E

The type of elements contained in this set.

Functions

Link copied to clipboard
open operator override fun contains(element: E): Boolean
Link copied to clipboard
open override fun containsAll(elements: Collection<E>): Boolean
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
open operator override fun iterator(): Iterator<E>
Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
open override val size: Int

Extensions

Link copied to clipboard

Returns a NotEmptyList containing all the elements of this collection, or throws an IllegalArgumentException if this collection is empty.

Returns a NotEmptyList containing all the elements of this collection, or an IllegalArgumentException if this collection is empty.

Link copied to clipboard
infix inline fun <E> Collection<E>.toNotEmptyListOrElse(defaultValue: (Collection<E>) -> NotEmptyList<E>): NotEmptyList<E>

Returns a NotEmptyList containing all the elements of this collection, or returns the result of calling the defaultValue function if this collection is empty.

Link copied to clipboard

Returns a NotEmptyList containing all the elements of this collection, or returns null if this collection is empty.

Link copied to clipboard

Returns a NotEmptyList containing all the elements of this collection, or throws an IllegalArgumentException if this collection is empty.

Link copied to clipboard

Returns a NotEmptySet containing all the elements of this collection, or an IllegalArgumentException if this collection is empty.

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

Link copied to clipboard
infix inline fun <E> Collection<E>.toNotEmptySetOrElse(defaultValue: (Collection<E>) -> NotEmptySet<E>): NotEmptySet<E>

Returns a NotEmptySet containing all the elements of this collection, or returns the result of calling the defaultValue function if this collection is empty.

Link copied to clipboard

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

Link copied to clipboard

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