asEnum

abstract fun <T : Enum<T>> asEnum(enum: Class<T>): T

This value as an enum, matches the enum value by name case-insensitively (e.g. "get" matches HttpMethod.GET)

Throws

if this value is not convertible to the provided enum