toChoiceList

fun toChoiceList(selectedChoices: List<T> = listOf(), widgetType: ValidatedChoiceList.WidgetType = ValidatedChoiceList.WidgetType.POPUP, translationProvider: BiFunction<T, String, MutableText> = BiFunction { t, _ -> t.transLit(t.toString()) }, descriptionProvider: BiFunction<T, String, Text> = BiFunction { t, _ -> t.descLit("") }): ValidatedChoiceList<T>

Converts this ValidatedList into ValidatedChoiceList wrapping this list as the valid choice options

Return

ValidatedChoiceList with options based on this list's contents

Author

fzzyhmstrs

Since

0.6.3

Parameters

selectedChoices

List<T> - The default selected choices of the resulting choice set. Can be empty.

translationProvider

BiFunction T, String, Text - converts a choice instance T and the base translation key of this ValidatedChoice into a text Translation

descriptionProvider

BiFunction T, String, Text - converts a choice instance T and the base translation key of this ValidatedChoice into a text Description: NOTE: translation key, not description key. This is the same base key as provided to translationProvider

widgetType

ValidatedChoiceList.WidgetType defines the GUI selection type. Defaults to POPUP