EnumUtils extension
Extensions on Enum for pattern-matching style dispatch.
- on
Properties
Methods
-
when<
R> (Map< Enum, R Function()> map) → R -
Available on Enum, provided by the EnumUtils extension
Calls the function corresponding to this enum value inmapand returns the result. -
whenOrElse<
R> (Map< Enum, R Function()> map, {required R orElse()}) → R -
Available on Enum, provided by the EnumUtils extension
Like when, but returnsorElseif this enum value is not inmap.