LifecycleHandler.fromJson constructor

LifecycleHandler.fromJson(
  1. Map<String, dynamic> json
)

Creates a LifecycleHandler from JSON data.

Implementation

factory LifecycleHandler.fromJson(Map<String, dynamic> json) {
  final tempExecJson = json['exec'];
  final tempHttpGetJson = json['httpGet'];
  final tempTcpSocketJson = json['tcpSocket'];

  final ExecAction? tempExec =
      tempExecJson != null ? ExecAction.fromJson(tempExecJson) : null;
  final HTTPGetAction? tempHttpGet = tempHttpGetJson != null
      ? HTTPGetAction.fromJson(tempHttpGetJson)
      : null;
  final TCPSocketAction? tempTcpSocket = tempTcpSocketJson != null
      ? TCPSocketAction.fromJson(tempTcpSocketJson)
      : null;

  return LifecycleHandler(
    exec: tempExec,
    httpGet: tempHttpGet,
    tcpSocket: tempTcpSocket,
  );
}