parse static method
Implementation
static MapMatcher parse(FilterExpr expr, OdmSystem system) {
switch(expr) {
case FilterNative():
return expr.obj as MapMatcher;
case FilterAnd():
var matchers = expr.filters.map((e) => MapMatcher.parse(e, system)).toList();
return MapFilterAndMatcher(matchers);
case FilterOr():
var matchers = expr.filters.map((e) => MapMatcher.parse(e, system)).toList();
return MatchFilterOrMatcher(matchers);
case FilterExists():
return MapFilterExistsMatcher(expr.field, expr.value);
case FilterEqStruct():
var document = system.serializeObject(expr.value, expr.typeArgument);
return MapMatcherEq(expr.field, document);
case FilterNeStruct():
var document = system.serializeObject(expr.value, expr.typeArgument);
return MapMatcherNe(expr.field, document);
case FilterEq():
return MapMatcherEq(expr.field, expr.value);
case FilterNe():
return MapMatcherNe(expr.field, expr.value);
case FilterLt():
return MapFilterLtMatcher(expr.field, expr.value);
case FilterGt():
return MapFilterGtMatcher(expr.field, expr.value);
case FilterLte():
return MapFilterLteMatcher(expr.field, expr.value);
case FilterGte():
return MapFilterGteMatcher(expr.field, expr.value);
case FilterArrayContains():
return MapFilterContainsMatcher(expr.field, expr.value);
case FilterIn():
return MapFilterInMatcher(expr.field, expr.values);
case FilterNotIn():
return MapFilterNotInMatcher(expr.field, expr.values);
}
}