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.1

Inheritors

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

Inheritors

Constructors

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

Types

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

Properties

Link copied to clipboard

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

Since Kotlin 1.1

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

Since Kotlin 1.0
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.1

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

Functions

Link copied to clipboard
protected fun clone(): Any

Throws an exception since enum constants cannot be cloned. This method prevents enum classes from inheriting from Cloneable.

Since Kotlin 1.1
protected fun clone(): Any

Throws an exception since enum constants cannot be cloned. This method prevents enum classes from inheriting from Cloneable.

Since Kotlin 1.0
Link copied to clipboard
operator override fun compareTo(other: E): 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.1
operator override fun compareTo(other: E): 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.0
Link copied to clipboard
operator override fun equals(other: Any?): Boolean
Since Kotlin 1.1
operator override fun equals(other: Any?): Boolean
Since Kotlin 1.0
Link copied to clipboard
override fun hashCode(): Int
Since Kotlin 1.1
override fun hashCode(): Int
Since Kotlin 1.0
Link copied to clipboard
open override fun toString(): String
Since Kotlin 1.1
open override fun toString(): String
Since Kotlin 1.0