toJson method
Converts a ComponentCondition instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempError = error;
final tempMessage = message;
final tempStatus = status;
final tempType = type;
if (tempError != null) {
jsonData['error'] = tempError;
}
if (tempMessage != null) {
jsonData['message'] = tempMessage;
}
jsonData['status'] = tempStatus;
jsonData['type'] = tempType;
return jsonData;
}