NotEmptyList

@Serializable(with = NotEmptyListSerializer::class)
@SinceKotoolsTypes(version = "4.0")
data class NotEmptyList<out E>

Representation of lists that contain at least one element of type E.

Functions

Link copied to clipboard
fun toList(): List<E>

Returns all elements of this list as a List of type E.

Link copied to clipboard
open override fun toString(): String

Returns the string representation of this list.

Properties

Link copied to clipboard
val head: E

The first element of this list.

Link copied to clipboard

The size of this list.

Link copied to clipboard
val tail: NotEmptyList<E>? = null

All elements of this list except the first one.