toJson method
Converts a RuntimeClass instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempApiVersion = apiVersion;
final tempHandler = handler;
final tempKind = kind;
final tempMetadata = metadata;
final tempOverhead = overhead;
final tempScheduling = scheduling;
if (tempApiVersion != null) {
jsonData['apiVersion'] = tempApiVersion;
}
jsonData['handler'] = tempHandler;
if (tempKind != null) {
jsonData['kind'] = tempKind;
}
if (tempMetadata != null) {
jsonData['metadata'] = tempMetadata.toJson();
}
if (tempOverhead != null) {
jsonData['overhead'] = tempOverhead.toJson();
}
if (tempScheduling != null) {
jsonData['scheduling'] = tempScheduling.toJson();
}
return jsonData;
}