Enum<T> class

Emulation of Java Enum class.

Example:

class Meter<int> extends Enum<int> {

 const Meter(int val) : super (val);

 static const Meter HIGH = const Meter(100);
 static const Meter MIDDLE = const Meter(50);
 static const Meter LOW = const Meter(10);
}

// and usage:

assert(Meter.HIGH, 100);
assert(Meter.HIGH is Meter);

Constructors

Enum(T _value)
const

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
value → T
read-only

Methods

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

Operators

operator ==(dynamic other) bool
The equality operator. [...]
override