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
SerializableField<V>/NamedField
a key to each field, an type parameter, with an generated string, use as json key;
effectively describe the memory allocation requirements
maps entirety of the struct
Serializable -
mixin in 1 step for serialization
provide toMap or implements MapBase and duplicate code until combine mixin is support
mixin toMap<K extends Enum, V>
implmenting Map would require subclasses to mixin MapBase
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
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
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