Enum class abstract interface

An enumerated value.

This class is implemented by all types and values introduced using an enum declaration. Non-platform classes cannot extend or mix in this class. Concrete classes cannot implement the interface.

The identifier used to name an enum value is available as a String, via the EnumName.name extension property on the enum value.

Available extensions
Annotations
  • @Since("2.14")

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setter
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

compareByIndex<T extends Enum>(T value1, T value2) int
Compares two enum values by their index.
compareByName<T extends Enum>(T value1, T value2) int
Compares enum values by name.