toJson method

Map<String, Object> toJson()

Converts a LifecycleHandler instance to JSON data.

Implementation

Map<String, Object> toJson() {
  final jsonData = <String, Object>{};

  final tempExec = exec;
  final tempHttpGet = httpGet;
  final tempTcpSocket = tcpSocket;

  if (tempExec != null) {
    jsonData['exec'] = tempExec.toJson();
  }

  if (tempHttpGet != null) {
    jsonData['httpGet'] = tempHttpGet.toJson();
  }

  if (tempTcpSocket != null) {
    jsonData['tcpSocket'] = tempTcpSocket.toJson();
  }

  return jsonData;
}