jsonMap method
If withCertificates is true and the stats contain certificates, they are printed in binary. If withCertificates is false and the stats contain certificates, their count is printed.
Implementation
@override
Map<String, Object> jsonMap({bool withCertificates: false}) {
Map<String, Object> map = new Map<String, Object>();
map['pingStats'] = pingStats.jsonMap();
if (certificates.isNotEmpty) {
map['certificates'] = (withCertificates
? certificates.map((Uint8List bytes) => base64.encode)
: certificates.length);
}
if (fromClient != null) {
map['fromClient'] = fromClient!.jsonMap();
}
if (fromServer != null) {
map['fromServer'] = fromServer!.jsonMap();
}
if (udpPacketCount != null) {
map['udpPacketCount'] = udpPacketCount!;
}
if (tcpPacketCount != null) {
map['tcpPacketCount'] = tcpPacketCount!;
}
if (clientVersion != null) {
map['clientVersion'] = clientVersion!.jsonMap();
}
if (celtVersions != null) {
map['celtVersions'] = celtVersions!;
}
if (address != null) {
map['address'] = address!.toString();
}
if (bandwidth != null) {
map['bandwidth'] = bandwidth!;
}
if (onlineTime != null) {
map['onlineTime'] = onlineTime!.toString();
}
if (idleTime != null) {
map['idleTime'] = idleTime!.toString();
}
if (strongCertificate != null) {
map['strongCertificate'] = strongCertificate!;
}
if (opus != null) {
map['opus'] = opus!;
}
return map;
}