toJson method
Converts a ContainerState instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempRunning = running;
final tempTerminated = terminated;
final tempWaiting = waiting;
if (tempRunning != null) {
jsonData['running'] = tempRunning.toJson();
}
if (tempTerminated != null) {
jsonData['terminated'] = tempTerminated.toJson();
}
if (tempWaiting != null) {
jsonData['waiting'] = tempWaiting.toJson();
}
return jsonData;
}