enum

fun <S, T : Enum<T>> enum(name: String, type: KClass<T>): RequiredArgumentConstructor<S, TypedEnumArgumentDescriptor<T>>

Creates an enum argument allowing all values of the specified enum type with name as the parameter name.

Enum values of T must have names that are distinct when case is ignored.

Author

Cypher121


fun <S> enum(name: String, values: List<String>): RequiredArgumentConstructor<S, StringEnumArgumentDescriptor>

Creates a string argument allowing only values specified in values with name as the parameter name.

All elements of values must be distinct when case is ignored.

Author

Cypher121


@JvmName(name = "enumAllowedSublist")
fun <S, T : Enum<T>> enum(name: String, values: List<T>): RequiredArgumentConstructor<S, MappedStringEnumArgumentDescriptor<T>>

Creates an enum argument allowing only values specified in values with name as the parameter name.

All elements of values must have names that are distinct when case is ignored.

Author

Cypher121


fun <S, T> enum(name: String, values: Map<String, T>): RequiredArgumentConstructor<S, MappedStringEnumArgumentDescriptor<T>>

Creates an enum argument allowing values specified by keys of values with name as the parameter name.

When read, the argument will convert the provided string to its respective value in values.

Keys of values must be distinct when case is ignored.

Author

Cypher121