factory Threshold.fromJson(Map<String, dynamic> json) { return Threshold( comparison: (json['Comparison'] as String?)?.toComparison(), thresholdValue: json['ThresholdValue'] as double?, ); }