StructInitializer<T extends StructBase<T, K, V>, K extends Field<V>, V> class

proxy over a map

Implemented types

Constructors

StructInitializer(Map<K, V> _init)
const

Properties

data StructData<K, V>
Proxy to allow the same keys Object as StructData<K, V> data passed to Keys
no setteroverride
fields Iterable<StructField<K, V>>
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
keys List<K>
a method from its TypeObject The ordered list of keys — defines the schema. Typically returns MyField.values for an enum-based key type.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
values Iterable<V>
no setteroverride

Methods

field(K key) StructField<K, V>
override
fieldAs<R>(Field<R> key) StructField<Field<R>, R>
override
fieldOrNull(K key) → V?
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<K, V>
Snapshot as an IndexMap. If K extends Enum, call .toJson() on the result to serialise via EnumMapByName.
override
toString() String
A string representation of this object.
inherited
trySetField(K key, V value) bool
override

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](covariant K key) → V
override
operator []=(covariant K key, V value) → void
override