toJSON method

  1. @override
Map<String, dynamic> toJSON()
override

Convert this NumberFilter to JSON

Implementation

@override
Map<String, dynamic> toJSON() {
  Map<String, T?> json = {};
  if (equal != null) {
    json[FilterField.equal] = equal;
  }
  if (notEqual != null) {
    json[FilterField.notEqual] = notEqual;
  }
  if (lessEqual != null) {
    json[FilterField.lessEqual] = lessEqual;
  }
  if (less != null) {
    json[FilterField.less] = less;
  }
  if (greaterEqual != null) {
    json[FilterField.greaterEqual] = greaterEqual;
  }
  if (greater != null) {
    json[FilterField.greater] = greater;
  }
  return json;
}