Provides static helper methods for enums.
Inheritance Hierarchy
Enum
Type Details
- yfiles module
- lang
- yfiles-umd modules
- All modules
- Legacy UMD name
- yfiles.lang.Enum
Static Methods
Returns the name of an enum constant.
Remarks
Note that for flags enums, this method throws an Exception if the provide value doesn't correspond to a single enum constant.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- type - Class
- The type of the enum.
- value - number
- The numeric value of the constant.
Returns
- ↪string
- The name of the constant.
Throws
- Exception({ name: 'Error' })
- If the given type is no enum or if the enum contains no constant of the given numeric value.
Returns the numeric value of the enum constant with the given name.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- type - Class
- The type of the enum.
- name - string
- The name of the enum constant.
- ignoreCase - boolean
- If
true
, name-matching is case-insensitive.
Returns
- ↪number
- The numeric value of the constant with the given name.