getAs

inline fun <E : Enum<E>> getAs(): E?

Attempts to retrieve the value as the specified enum type.

Return

The enum value if this is an EnumValue of the correct type, null otherwise

Parameters

E

The expected enum type


fun <E : Enum<E>> getAs(kClass: KClass<E>): E?

Attempts to retrieve the value as the specified enum type using KClass.

Return

The enum value if this is an EnumValue of the correct type, null otherwise

Parameters

E

The expected enum type

kClass

The KClass of the expected enum type