@Test public void mustPassOneIsNotSupported() { FilterAdapterContext context = new FilterAdapterContext(new Scan(), new DefaultReadHooks()); PageFilter filter = new PageFilter(20); FilterList filterList = new FilterList(Operator.MUST_PASS_ONE, filter); try (ContextCloseable ignroed = context.beginFilterList(filterList)) { FilterSupportStatus status = pageFilterAdapter.isFilterSupported(context, filter); Assert.assertFalse( "MUST_PASS_ONE FilterLists should not be supported.", status.isSupported()); } }
@Override public FilterSupportStatus isFilterSupported(FilterAdapterContext context, PageFilter filter) { Optional<FilterList> currentList = context.getCurrentFilterList(); if ((currentList.isPresent() && !isFilterListSupported(currentList.get(), filter)) || context.getFilterListDepth() > 1) { return TOP_LEVEL_ONLY; } return FilterSupportStatus.SUPPORTED; }
PageFilterAdapter extends TypedFilterAdapterBase<PageFilter> { @Override public FilterSupportStatus isFilterSupported(FilterAdapterContext context, PageFilter filter) { Optional<FilterList> currentList = context.getCurrentFilterList(); if ((currentList.isPresent() && !isFilterListSupported(currentList.get(), filter)) || context.getFilterListDepth() > 1) { return TOP_LEVEL_ONLY; } return FilterSupportStatus.SUPPORTED; } }
PageFilterAdapter extends TypedFilterAdapterBase<PageFilter> { @Override public FilterSupportStatus isFilterSupported(FilterAdapterContext context, PageFilter filter) { Optional<FilterList> currentList = context.getCurrentFilterList(); if ((currentList.isPresent() && !isFilterListSupported(currentList.get(), filter)) || context.getFilterListDepth() > 1) { return TOP_LEVEL_ONLY; } return FilterSupportStatus.SUPPORTED; }  }
PageFilterAdapter extends TypedFilterAdapterBase<PageFilter> { @Override public FilterSupportStatus isFilterSupported(FilterAdapterContext context, PageFilter filter) { Optional<FilterList> currentList = context.getCurrentFilterList(); if ((currentList.isPresent() && !isFilterListSupported(currentList.get(), filter)) || context.getFilterListDepth() > 1) { return TOP_LEVEL_ONLY; } return FilterSupportStatus.SUPPORTED; }  @Override Filter adapt(FilterAdapterContext context, PageFilter filter); @Override FilterSupportStatus isFilterSupported(FilterAdapterContext context, PageFilter filter); }
PageFilterAdapter extends TypedFilterAdapterBase<PageFilter> { @Override public FilterSupportStatus isFilterSupported(FilterAdapterContext context, PageFilter filter) { Optional<FilterList> currentList = context.getCurrentFilterList(); if ((currentList.isPresent() && !isFilterListSupported(currentList.get(), filter)) || context.getFilterListDepth() > 1) { return TOP_LEVEL_ONLY; } return FilterSupportStatus.SUPPORTED; }  @Override Filter adapt(FilterAdapterContext context, PageFilter filter); @Override FilterSupportStatus isFilterSupported(FilterAdapterContext context, PageFilter filter);  }