ExtJSONHelper<K, V> extension
Typed field lookup/coercion helpers for JSON-decoded maps.
- on
-
- Map<
K, V>
- Map<
Methods
-
ensureKeyExists(
K key) → void -
Available on Map<
Throws ifK, V> , provided by the ExtJSONHelper extensionkeyisn't present in this map. -
hasValue(
K key) → bool -
Available on Map<
WhetherK, V> , provided by the ExtJSONHelper extensionkeyis present and its value isn't null. -
oneOf<
E, T> ({required List< K> keys, required E parse(K key, T e)}) → E -
Available on Map<
Tries each ofK, V> , provided by the ExtJSONHelper extensionkeysin order, returning the first one present (parsed viaparse). -
valueAs<
T extends Object?> (K key, {bool? allowHex, StringEncoding? encoding, bool asBytes = false, T onMissing()?, bool normalizeKeyLookup = false, T onError(BuError err)?}) → T -
Available on Map<
ReadsK, V> , provided by the ExtJSONHelper extensionkeyand coerces it to whichever concrete type T is. -
valueAsBigInt<
T extends BigInt?> (K key, {bool allowHex = false, T onError(BuError err)?, T onMissing()?, bool? sign, bool allowDecimals = false, bool normalizeKeyLookup = false}) → T -
Available on Map<
ReadsK, V> , provided by the ExtJSONHelper extensionkeyand coerces it to a BigInt. -
valueAsBool<
T extends bool?> (K key, {T onError(BuError err)?, T onMissing()?, bool normalizeKeyLookup = false}) → T -
Available on Map<
ReadsK, V> , provided by the ExtJSONHelper extensionkeyand coerces it to a bool. -
valueAsBytes<
T extends List< (int> ?>K key, {bool allowHex = true, StringEncoding? encoding, bool allowJson = false, T onMissing()?, bool normalizeKeyLookup = false, T onError(BuError err)?}) → T -
Available on Map<
ReadsK, V> , provided by the ExtJSONHelper extensionkeyand coerces it to bytes. -
valueAsDouble<
T extends double?> (K key, {T onError(BuError err)?, T onMissing()?, bool normalizeKeyLookup = false}) → T -
Available on Map<
ReadsK, V> , provided by the ExtJSONHelper extensionkeyand coerces it to a double. -
valueAsInt<
T extends int?> (K key, {bool allowHex = false, bool allowDouble = false, T onError(BuError err)?, T onMissing()?, bool normalizeKeyLookup = false}) → T -
Available on Map<
ReadsK, V> , provided by the ExtJSONHelper extensionkeyand coerces it to an int. -
valueAsList<
T extends List?> (K key, {T onError(BuError err)?, T onMissing()?, bool normalizeKeyLookup = false}) → T -
Available on Map<
ReadsK, V> , provided by the ExtJSONHelper extensionkeyand coerces it to a List. -
valueAsMap<
T extends Map?> (K key, {T onError(BuError err)?, T onMissing()?, bool normalizeKeyLookup = false}) → T -
Available on Map<
ReadsK, V> , provided by the ExtJSONHelper extensionkeyand coerces it to a Map. -
valueAsNum<
T extends num?> (K key, {bool allowHex = false, bool allowDouble = false, T onError(BuError err)?, T onMissing()?, bool normalizeKeyLookup = false}) → T -
Available on Map<
ReadsK, V> , provided by the ExtJSONHelper extensionkeyand coerces it to a num. -
valueAsSet<
T extends Set?> (K key, {T onError(BuError err)?, T onMissing()?, bool normalizeKeyLookup = false}) → T -
Available on Map<
ReadsK, V> , provided by the ExtJSONHelper extensionkeyand coerces it to a Set. -
valueAsString<
T extends String?> (K key, {T onError(BuError err)?, T onMissing()?, bool allowJson = false, bool allowHexEncoding = false, StringEncoding? bytesEncoding = StringEncoding.utf8, bool normalizeKeyLookup = false}) → T -
Available on Map<
ReadsK, V> , provided by the ExtJSONHelper extensionkeyand coerces it to a String. -
valueEnsureAsList<
T> (K key, {List< T> onError(BuError err)?, List<T> onMissing()?, bool normalizeKeyLookup = false}) → List<T> -
Available on Map<
ReadsK, V> , provided by the ExtJSONHelper extensionkeyand casts it toList<T>. -
valueEnsureAsMap<
KK, VV> (K key, {Map< KK, VV> onError(BuError err)?, Map<KK, VV> onMissing()?, bool normalizeKeyLookup = false}) → Map<KK, VV> -
Available on Map<
ReadsK, V> , provided by the ExtJSONHelper extensionkeyand casts it toMap<KK, VV>. -
valueEnsureAsSet<
T> (K key, {Set< T> onError(BuError err)?, Set<T> onMissing()?, bool normalizeKeyLookup = false}) → Set<T> -
Available on Map<
ReadsK, V> , provided by the ExtJSONHelper extensionkeyand casts it toSet<T>. -
valueTo<
T extends Object?, VV extends Object?> ({required K key, required T parse(VV v), bool? allowHex, StringEncoding? encoding, bool asBytes = false, T onMissing()?, T onError(BuError err)?, bool normalizeKeyLookup = false}) → T -
Available on Map<
ReadsK, V> , provided by the ExtJSONHelper extensionkey, coerces it toVV, then appliesparseto build aT.