Skip to content

EnumConverter<E>

extendsConverter<E>

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

Converters.kt

Constructors

EnumConverter

<E> EnumConverter(entries: List<E>, typeName: String)
entries

the enum's constants.

typeName

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

Converters.kt

Properties

typeName

open override val typeName: String
Converters.kt

Functions

convert

open override fun convert(raw: String): E

Parses raw into a value of type T.

ThrowsArgotConversionException

if raw cannot be converted.

Converters.kt

Released under the Apache License 2.0.