asEnum

open fun <T : Enum<T>?> asEnum(enumClass: Class<T>, defaultValue: T): EnumSet<T>
open fun <T : Enum<T>?> asEnum(enumClass: Class<T>, defaultValue: EnumSet<T>): EnumSet<T>

Attempts to convert and return the value of this instance as an enum. If the conversion is invalid, the default value is returned.

Return

The value of this instance as an unsigned byte.

Parameters

<T>

the type of the enum to convert to

enumClass

the type of the enum to convert to

defaultValue

The default value to return if the conversion is invalid.