fromEnum

fun <E : Enum<E>> fromEnum(enumType: Class<E>, instructions: String, description: Function<E, String>): CategoryMapping<E>

Define categories from enum names in declaration order, never ordinal or toString. Use an explicit mapping instead when IDs must survive enum constant renames.

Return

the mapping

Parameters

enumType

the enum whose constants are the categories

instructions

what the model is asked

description

describes when each constant applies