Documentation ¶
Overview ¶
Package enum provides concrete types to create enumerated collections
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEnumItemImpl ¶
func NewEnumItemImpl[K constraints.Ordered, V any](value V, key K, full string) (item parl.EnumItem[K, V])
NewEnumItemImpl returns a concrete value representing an element of an ordered collection used to implement Integer enumeratiopns and bit-fields
Types ¶
type EnumItemImpl ¶
type EnumItemImpl[K constraints.Ordered, V any] struct { ValueV V // key that maps to this enumeration value KeyK K // sentence describing this flag Full string }
EnumItemImpl is an value or flag-value item of an enumeration container.
- K is the type of a unique key mapping one-to-one to an enumeration value
- V is the type of the internally used value representation
func (*EnumItemImpl[K, V]) Description ¶
func (item *EnumItemImpl[K, V]) Description() (desc string)
Description returns a descriptive sentence for this enumeration value
func (*EnumItemImpl[K, V]) Key ¶
func (item *EnumItemImpl[K, V]) Key() (key K)
Key returns the key for this enumeration value
func (*EnumItemImpl[K, V]) String ¶
func (item *EnumItemImpl[K, V]) String() (s string)
func (*EnumItemImpl[K, V]) Value ¶
func (item *EnumItemImpl[K, V]) Value() (value V)
Value returns this enumeration value’s value using the restricted type
Click to show internal directories.
Click to hide internal directories.