Map<String, dynamic> toJson() { final comparison = this.comparison; final value = this.value; return { if (comparison != null) 'Comparison': comparison.toValue(), if (value != null) 'Value': value, }; }