Abstract
Constructor.
the unique name for this type
the key value associated with this type
Get the key value.
the key value
Get the enum name.
the name
Test if a string is equal to this enum's name.
As long as enum values are consistently obtained from the Util.Enum.enumValues
array then enum instances can be compared with ===
. If unsure, this method can be used
to compare string values instead.
If value
is passed as an actual Enum instance, then if that enum is the same class
as this enum it's name
is compared to this instance's name
.
the value to test
true
if value
is the same as this instance's name
value
Static
enumsThis method takes an array of enums and turns them into a mapped object, using the enum
name
as object property names.
the enum list to turn into a value object
an object with enum name
properties with associated enum values
Static
Abstract
enumGet all enum values.
This method must be overridden by subclasses to return something meaningful. This implementation returns an empty array.
all enum values
Static
namesStatic
valueGet an enum instance from its key or name.
This method searches the Util.Enum.enumValues array for a matching key or name value.
the enum key or name to get the enum instance for
the matching enum value, or undefined
if no values match
An immutable enum-like object with an associated key value.
This class must be extended by another class that overrides the inerited Util.Enum.enumValues method.