general/enum_map library

Classes

FixedMap<K, V>
FixedMap - interface for Map constraints FixedMap - fixed set of keys optimized for small fixed set of keys guarantees all keys are present can guarantee non null return - if V is defined as non nullable
IndexMap<K extends dynamic, V>
IndexMap Default implementation using parallel arrays

Extension Types

EnumMap
EnumMap A Map with the additional constraint that Keys are a fixed set, via Enum. creation implements FixedMap/IndexMap constraints factory constructors build IndexMap by default wrap String handling via .name around IndexMap. Adds Serialization using Enum.name to a Map, Keys inherit from Enum - index via Enum.index -> create a parallel array map by default String name via Enum.name -> directly use for serialization
EnumMapFactory
construct a Map<K extends Enum, V> from Map<String, V> on creation ensure all fields are valid

Extensions

EnumMapByName on Map<K, V>
Serialization of Map<Enum, V> interface Methods on loose contraints Map<Enum, V> Enum.name base methods are applicable regardless of EnumMap FixedMap constraints add fills existing Map only
EnumNamedValues on Iterable<MapEntry<K, V>>
Extensions