Enum

abstract class Enum<E : Enum<E>>(name: String, ordinal: Int) : Comparable<E> (source)

The common base class of all enum classes. See the Kotlin language documentation for more information on enum classes.

Since Kotlin

1.2
abstract class Enum<E : Enum<E>>(name: String, ordinal: Int) : Comparable<E> (source)

The common base class of all enum classes. See the Kotlin language documentation for more information on enum classes.

Since Kotlin

1.0
abstract class Enum<E : Enum<E>>(name: String, ordinal: Int) : Comparable<E> (source)

The common base class of all enum classes. See the Kotlin language documentation for more information on enum classes.

Since Kotlin

1.1
abstract class Enum<E : Enum<E>>(val name: String, val ordinal: Int) : Comparable<E> (source)

The common base class of all enum classes. See the Kotlin language documentation for more information on enum classes.

Since Kotlin

1.3

Constructors

Link copied to clipboard
fun Enum(name: String, ordinal: Int)
fun Enum(name: String, ordinal: Int)
fun Enum(name: String, ordinal: Int)
fun Enum(name: String, ordinal: Int)

Types

Link copied to clipboard
object Companion
Since Kotlin 1.2
object Companion
Since Kotlin 1.0
object Companion
Since Kotlin 1.1
object Companion
Since Kotlin 1.3

Properties

Link copied to clipboard

Returns the name of this enum constant, exactly as declared in its enum declaration.

Since Kotlin 1.2

Returns the name of this enum constant, exactly as declared in its enum declaration.

Since Kotlin 1.0

Returns the name of this enum constant, exactly as declared in its enum declaration.

Since Kotlin 1.1
Since Kotlin 1.3
Link copied to clipboard

Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero).

Since Kotlin 1.2

Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero).

Since Kotlin 1.0

Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero).

Since Kotlin 1.1
Since Kotlin 1.3

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
infix inline fun <T> Comparable<T>.compareTo(other: T): Int
infix inline fun <T> Comparable<T>.compareTo(other: T): Int
infix inline fun <T> Comparable<T>.compareTo(other: T): Int
infix inline fun <T> Comparable<T>.compareTo(other: T): Int

Compares this object with the specified object for order. Returns zero if this object is equal to the specified other object, a negative number if it's less than other, or a positive number if it's greater than other.

Since Kotlin 1.6
Link copied to clipboard

Returns a Java Class instance of the enum the given constant belongs to.

Since Kotlin 1.7