mixin

EnumItems

@Js
const mixin EnumItems : ItemList

EnumItems is an ordered collection of EnumItem modeling an enumeration. It is the single model for the enum tag in every shape that tag is allowed to take. Construct via PiEnv.enum.

fields none

Empty enumeration

methods format

Formatter which displays a value using its item text

isEmpty

Return if this enumeration has no items

item

Lookup an item by its string key

itemForData

Lookup the item for a data value

keys

List the string keys in order

list

Items of this enumeration

toStr

Comma separated keys

format abstract Format format()

Formatter which displays a value using its item text

isEmpty abstract Bool isEmpty()

Return if this enumeration has no items

item abstract EnumItem? item(Str key, Bool checked := true)

Lookup an item by its string key

itemForData abstract EnumItem? itemForData(Obj? data)

Lookup the item for a data value. A Str matches by key; a Bool selects by ordinal so a two item enum can range a Bool as "false,true". Returns null if there is no match.

keys abstract Str[] keys()

List the string keys in order

list abstract EnumItem[] list()

Items of this enumeration

none const static EnumItems : none

Empty enumeration

toStr virtual Str toStr()

Comma separated keys

Haxall 4.0.7 ∙ 27-Oct-2026 09:10 EDT