@override Object toJson() => { 'parent': parent, if (memory case final memory?) 'memory': memory.toJson(), };