EnumConverter

class EnumConverter<out E : Enum<*>>(entries: List<E>, val typeName: String) : Converter<E>

Matches a raw value against enum constant names, case-insensitively.

Parameters

entries

the enum's constants.

typeName

the enum's name, shown in help and error messages.

Constructors

Link copied to clipboard
constructor(entries: List<E>, typeName: String)

Properties

Link copied to clipboard
open override val typeName: String

Functions

Link copied to clipboard
open override fun convert(raw: String): E

Parses raw into a value of type T.