DataElement<K> class abstract interface

An interface for a data element that is a collection with accessors for typed values.

May aggregate other collections - data objects and arrays - too as values.

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

As this class is defined with the class modifier interface, the class can only be implemented, but not extended. This class also do not provide any base implementations, but the known two subtypes are DataArray and DataObject.

Implemented types
Implementers

Constructors

DataElement()

Properties

arrays Iterable<DataArray>
Returns an iterable for childs that can be represented as DataArray.
no setter
hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Returns true if the collection has no elements.
no setterinherited
isNotEmpty bool
Returns true if the collection has at least one element.
no setterinherited
length int
Returns the number of elements in this collection.
no setterinherited
objects Iterable<DataObject>
Returns an iterable for childs that can be represented as DataObject.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

array(K key) DataArray
Returns a child data array at key.
arraysToList<T extends Object>(T map(DataArray array), {int? limit}) List<T>
Returns a list of T mapped from child data arrays using map function.
encodeJson({Object encodeTime(DateTime time)?}) String
Encodes this element into a JSON string.
exists(K key) bool
Returns true if the key references an existing value, null or non-null.
inherited
existsNonNull(K key) bool
Returns true if a value at key exists and that value is non-null.
inherited
existsNull(K key) bool
Returns true if a value at key exists and that value is null.
inherited
getBigInt(K key, {BigInt? min, BigInt? max}) BigInt
Returns a value at key as BigInt.
inherited
getBool(K key) bool
Returns a value at key as bool.
inherited
getDouble(K key, {double? min, double? max}) double
Returns a value at key as double.
inherited
getId(K key) Identifier
Returns a value at key as Identifier.
inherited
getInt(K key, {int? min, int? max}) int
Returns a value at key as int.
inherited
getNum(K key, {num? min, num? max}) num
Returns a value at key as num.
inherited
getString(K key) String
Returns a value at key as String.
inherited
getTimeUTC(K key, {DateTime parse(Object?)?}) DateTime
Returns a value at key as DateTime in the UTC time zone.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
object(K key) DataObject
Returns a child data object at key.
objectsToList<T extends Object>(T map(DataObject object), {int? limit}) List<T>
Returns a list of T mapped from child data objects using map function.
toJson() → dynamic
Returns data as an encodable object compatible with json.encode().
toString() String
A string representation of this object.
inherited
tryArray(K key) DataArray?
Returns a child data array at key or null if missing.
tryBigInt(K key, {BigInt? min, BigInt? max}) BigInt?
Returns a value at key as BigInt or null if missing.
inherited
tryBool(K key) bool?
Returns a value at key as bool or null if missing.
inherited
tryDouble(K key, {double? min, double? max}) double?
Returns a value at key as double or null if missing.
inherited
tryId(K key) Identifier?
Returns a value at key as Identifier or null if missing.
inherited
tryInt(K key, {int? min, int? max}) int?
Returns a value at key as int or null if missing.
inherited
tryNum(K key, {num? min, num? max}) num?
Returns a value at key as num or null if missing.
inherited
tryObject(K key) DataObject?
Returns a child data object at key or null if missing.
tryString(K key) String?
Returns a value at key as String or null if missing.
inherited
tryTimeUTC(K key, {DateTime parse(Object?)?}) DateTime?
Returns a value at key as DateTime in the UTC time zone, or null.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](K key) Object?
Returns a value at key, the result can be of any object or null.
inherited