fromJSON method

  1. @override
void fromJSON(
  1. dynamic json
)
override

Deserialize a JSON object to map values to this NumberFilter

Implementation

@override
void fromJSON(dynamic json) {
  if (json is! Map<String, dynamic>) {
    return;
  }

  if (json.containsKey(FilterField.greaterEqual)) {
    greaterEqual = json[FilterField.greaterEqual];
  }
  if (json.containsKey(FilterField.lessEqual)) {
    lessEqual = json[FilterField.lessEqual];
  }
  if (json.containsKey(FilterField.greater)) {
    greater = json[FilterField.greater];
  }
  if (json.containsKey(FilterField.less)) {
    less = json[FilterField.less];
  }
  if (json.containsKey(FilterField.equal)) {
    equal = json[FilterField.equal];
  }
  if (json.containsKey(FilterField.notEqual)) {
    notEqual = json[FilterField.notEqual];
  }
}