@Test public void testCreateFilter_singleField_equalsOrNull() throws Exception { SingleFieldValueFilter<String, WebPage> filter = createUrlFilter(); filter.setFilterOp(FilterOp.EQUALS); filter.setFilterIfMissing(false); Bson dbObject = filterFactory.createFilter(filter, store); assertEquals(new JSONObject("{ \"$or\" : [ { \"url\" : { \"$exists\" : false}} , " + "{ \"url\" : \"http: }
@Override public Bson createFilter(final Filter<K, T> filter, final MongoStore<K, T> store) { if (filter instanceof FilterList) { FilterList<K, T> filterList = (FilterList<K, T>) filter; return transformListFilter(filterList, store); } else if (filter instanceof SingleFieldValueFilter) { SingleFieldValueFilter<K, T> fieldFilter = (SingleFieldValueFilter<K, T>) filter; return transformFieldFilter(fieldFilter, store); } else if (filter instanceof MapFieldValueFilter) { MapFieldValueFilter<K, T> mapFilter = (MapFieldValueFilter<K, T>) filter; return transformMapFilter(mapFilter, store); } else { LOG.warn("MongoDB remote filter not yet implemented for " + filter.getClass().getCanonicalName()); return null; } }
DefaultFactory extends
    BaseFactory<K, T> { @Override public Bson createFilter(final Filter<K, T> filter, final MongoStore<K, T> store) { if (filter instanceof FilterList) { FilterList<K, T> filterList = (FilterList<K, T>) filter; return transformListFilter(filterList, store); } else if (filter instanceof SingleFieldValueFilter) { SingleFieldValueFilter<K, T> fieldFilter = (SingleFieldValueFilter<K, T>) filter; return transformFieldFilter(fieldFilter, store); } else if (filter instanceof MapFieldValueFilter) { MapFieldValueFilter<K, T> mapFilter = (MapFieldValueFilter<K, T>) filter; return transformMapFilter(mapFilter, store); } else { LOG.warn("MongoDB remote filter not yet implemented for " + filter.getClass().getCanonicalName()); return null; } } }
DefaultFactory extends
    BaseFactory<K, T> { @Override public Bson createFilter(final Filter<K, T> filter, final MongoStore<K, T> store) { if (filter instanceof FilterList) { FilterList<K, T> filterList = (FilterList<K, T>) filter; return transformListFilter(filterList, store); } else if (filter instanceof SingleFieldValueFilter) { SingleFieldValueFilter<K, T> fieldFilter = (SingleFieldValueFilter<K, T>) filter; return transformFieldFilter(fieldFilter, store); } else if (filter instanceof MapFieldValueFilter) { MapFieldValueFilter<K, T> mapFilter = (MapFieldValueFilter<K, T>) filter; return transformMapFilter(mapFilter, store); } else { LOG.warn("MongoDB remote filter not yet implemented for " + filter.getClass().getCanonicalName()); return null; } }  }
DefaultFactory extends
    BaseFactory<K, T> { @Override public Bson createFilter(final Filter<K, T> filter, final MongoStore<K, T> store) { if (filter instanceof FilterList) { FilterList<K, T> filterList = (FilterList<K, T>) filter; return transformListFilter(filterList, store); } else if (filter instanceof SingleFieldValueFilter) { SingleFieldValueFilter<K, T> fieldFilter = (SingleFieldValueFilter<K, T>) filter; return transformFieldFilter(fieldFilter, store); } else if (filter instanceof MapFieldValueFilter) { MapFieldValueFilter<K, T> mapFilter = (MapFieldValueFilter<K, T>) filter; return transformMapFilter(mapFilter, store); } else { LOG.warn("MongoDB remote filter not yet implemented for " + filter.getClass().getCanonicalName()); return null; } }  @Override List<String> getSupportedFilters(); @Override Bson createFilter(final Filter<K, T> filter,
                           final MongoStore<K, T> store); }
DefaultFactory extends
    BaseFactory<K, T> { @Override public Bson createFilter(final Filter<K, T> filter, final MongoStore<K, T> store) { if (filter instanceof FilterList) { FilterList<K, T> filterList = (FilterList<K, T>) filter; return transformListFilter(filterList, store); } else if (filter instanceof SingleFieldValueFilter) { SingleFieldValueFilter<K, T> fieldFilter = (SingleFieldValueFilter<K, T>) filter; return transformFieldFilter(fieldFilter, store); } else if (filter instanceof MapFieldValueFilter) { MapFieldValueFilter<K, T> mapFilter = (MapFieldValueFilter<K, T>) filter; return transformMapFilter(mapFilter, store); } else { LOG.warn("MongoDB remote filter not yet implemented for " + filter.getClass().getCanonicalName()); return null; } }  @Override List<String> getSupportedFilters(); @Override Bson createFilter(final Filter<K, T> filter,
                           final MongoStore<K, T> store);  }