toJson method
Converts a CSINodeDriver instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempAllocatable = allocatable;
final tempName = name;
final tempNodeID = nodeID;
final tempTopologyKeys = topologyKeys;
if (tempAllocatable != null) {
jsonData['allocatable'] = tempAllocatable.toJson();
}
jsonData['name'] = tempName;
jsonData['nodeID'] = tempNodeID;
if (tempTopologyKeys != null) {
jsonData['topologyKeys'] = tempTopologyKeys;
}
return jsonData;
}