PrimitiveAccessor<K> class abstract interface

An interface to access typed primitive values by keys of type K.

Normally K is either String or int, but could be other types also.

Implementations should support accessing at least following types: String, int, BigInt, double, bool and Null.

Implementers

Constructors

PrimitiveAccessor()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

exists(K key) bool
Returns true if the key references an existing value, null or non-null.
existsNonNull(K key) bool
Returns true if a value at key exists and that value is non-null.
existsNull(K key) bool
Returns true if a value at key exists and that value is null.
getBigInt(K key, {BigInt? min, BigInt? max}) BigInt
Returns a value at key as BigInt.
getBool(K key) bool
Returns a value at key as bool.
getDouble(K key, {double? min, double? max}) double
Returns a value at key as double.
getInt(K key, {int? min, int? max}) int
Returns a value at key as int.
getNum(K key, {num? min, num? max}) num
Returns a value at key as num.
getString(K key) String
Returns a value at key as String.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
tryBigInt(K key, {BigInt? min, BigInt? max}) BigInt?
Returns a value at key as BigInt or null if missing.
tryBool(K key) bool?
Returns a value at key as bool or null if missing.
tryDouble(K key, {double? min, double? max}) double?
Returns a value at key as double or null if missing.
tryInt(K key, {int? min, int? max}) int?
Returns a value at key as int or null if missing.
tryNum(K key, {num? min, num? max}) num?
Returns a value at key as num or null if missing.
tryString(K key) String?
Returns a value at key as String or null if missing.

Operators

operator ==(Object other) bool
The equality operator.
inherited