toJson method
Converts a ServiceReference instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
jsonData['name'] = name;
jsonData['namespace'] = namespace;
if (path != null) {
jsonData['path'] = path!;
}
if (port != null) {
jsonData['port'] = port!;
}
return jsonData;
}