EnumType

class EnumType<E : Enum<E>>(name: String, values: Array<E>, displaySelector: (E) -> String) : Group.PermissionKey<E>

EnumType represents permissions backed by an enum. It maps between enum entries and their display strings.

Parameters

values

array of enum entries to choose from

displaySelector

function to obtain the display string for an enum entry

Constructors

Link copied to clipboard
constructor(name: String, values: Array<E>, displaySelector: (E) -> String)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun parseFromMenu(text: String): E

Parse the permission value from the menu text representation.

Link copied to clipboard
open override fun toMenuText(value: E): String

Convert a value to the text representation shown in menus.