toJSON method

Map<String, dynamic> toJSON()

Transforms this instance into a JSON object.

Implementation

Map<String,dynamic> toJSON() {
	final Map<String,dynamic> json = {
		'type': runtimeType.toString(),
		'owner': owner?.uuid,
		'records': [],
		'memorySpan': memorySpan
	};

	final records = this.records;

	for ( int i = 0, l = records.length; i < l; i ++ ) {
		final record = records[ i ];
		json['records']?.add( record.toJSON() );
	}

	return json;
}