Package-level declarations

Contains types such as NotEmptyList for manipulating collections.

Types

Link copied to clipboard
sealed interface NotEmptyCollection<out E>

Represents a collection that has at least one element of type E.

Link copied to clipboard
value class NotEmptyList<out E> : NotEmptyCollection<E>

Represents a list that has at least one element of type E.

Link copied to clipboard
value class NotEmptyMap<K, out V>

Represents a map that has at least one entry, with a key of type K and a value of type V.

Link copied to clipboard
value class NotEmptySet<out E> : NotEmptyCollection<E>

Represents a set that has at least one element of type E.

Properties

Link copied to clipboard

Returns the size of this collection, or returns ZeroInt if this collection is null.

Functions

Link copied to clipboard
fun <E> notEmptyListOf(head: E, vararg tail: E): NotEmptyList<E>

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

Link copied to clipboard
fun <K, V> notEmptyMapOf(head: Pair<K, V>, vararg tail: Pair<K, V>): NotEmptyMap<K, V>

Creates a NotEmptyMap starting with a head and containing all the entries of the optional tail.

Link copied to clipboard
fun <E> notEmptySetOf(head: E, vararg tail: E): NotEmptySet<E>

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

Link copied to clipboard

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

Link copied to clipboard

Returns an encapsulated NotEmptyMap containing all the entries of this map, or returns an encapsulated IllegalArgumentException if this map is empty.

Link copied to clipboard

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