Object to Map serializer
@override Map<String, dynamic> toJson() { return { '@type': 'count', if (extra != null) '@extra': extra, 'count': count }; }