toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final name = this.name;
  final statistic = this.statistic;
  final threshold = this.threshold;
  final unit = this.unit;
  return {
    if (name != null) 'Name': name.toValue(),
    if (statistic != null) 'Statistic': statistic.toValue(),
    if (threshold != null) 'Threshold': threshold,
    if (unit != null) 'Unit': unit.toValue(),
  };
}