@Test public void testCreateFilter_list_2() throws Exception { FilterList<String, WebPage> filter = new FilterList<>(); MapFieldValueFilter<String, WebPage> hFilter = createHeadersFilter(); hFilter.setFilterIfMissing(true); hFilter.setFilterOp(FilterOp.EQUALS); filter.addFilter(hFilter); SingleFieldValueFilter<String, WebPage> urlFilter = createUrlFilter(); urlFilter.setFilterIfMissing(true); urlFilter.setFilterOp(FilterOp.EQUALS); filter.addFilter(urlFilter); Bson dbObject = filterFactory.createFilter(filter, store); assertEquals(new JSONObject("{ \"h.C·T\" : \"text/html\" , \"url\" : \"http: new JSONObject(asJson(dbObject)).toString()); }
@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);  }