Package-level declarations

Utilities for working with Kotlin enum classes.

Types

Link copied to clipboard
sealed interface EnumEntries<E : Enum<E>> : List<E>

A specialized immutable implementation of List interface that contains all enum entries of the specified enum type E. EnumEntries contains all enum entries in the order they are declared in the source code, consistently with the corresponding Enum.ordinal values.

Since Kotlin 1.9

Functions

Link copied to clipboard
inline fun <T : Enum<T>> enumEntries(): EnumEntries<T>

Returns EnumEntries list containing all enum entries for the given enum type T.

Since Kotlin 2.0