From 19b42d6ee408d0711ed6e13c3d833b487e36e834 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Tue, 24 Jan 2017 10:38:57 +0200 Subject: Unify container wrapping (#8312) * Method names unified to withXyzFilter * withConfigurableFilter moved to DataProvider * Remove DataProviderWrapper.convert since it does the same as DataProvider.withConvertedFilter * Make javadocs slightly more consistent * Make type parameters consistent --- .../vaadin/data/provider/BackEndDataProvider.java | 41 ---------------------- 1 file changed, 41 deletions(-) (limited to 'server/src/main/java/com/vaadin/data/provider/BackEndDataProvider.java') diff --git a/server/src/main/java/com/vaadin/data/provider/BackEndDataProvider.java b/server/src/main/java/com/vaadin/data/provider/BackEndDataProvider.java index 199d0b64fe..f20b22fa17 100644 --- a/server/src/main/java/com/vaadin/data/provider/BackEndDataProvider.java +++ b/server/src/main/java/com/vaadin/data/provider/BackEndDataProvider.java @@ -18,8 +18,6 @@ package com.vaadin.data.provider; import java.util.Collections; import java.util.List; -import com.vaadin.server.SerializableBiFunction; - /** * A data provider that lazy loads items from a back end. * @@ -74,43 +72,4 @@ public interface BackEndDataProvider extends DataProvider { return false; } - /** - * Wraps this data provider to create a data provider that supports - * programmatically setting a filter that will be combined with a filter - * provided through the query. - * - * @see #withConfigurableFilter() - * - * @param filterCombiner - * a callback for combining and the configured filter with the - * filter from the query to get a filter to pass to the wrapped - * provider. Will only be called if the query contains a filter. - * - * @return a data provider with a configurable filter, not null - */ - public default ConfigurableFilterDataProvider withConfigurableFilter( - SerializableBiFunction filterCombiner) { - return new ConfigurableFilterDataProviderWrapper(this) { - @Override - protected F combineFilters(F configuredFilter, C queryFilter) { - return filterCombiner.apply(configuredFilter, queryFilter); - } - }; - } - - /** - * Wraps this data provider to create a data provider that supports - * programmatically setting a filter but no filtering through the query. - * - * @see #withConfigurableFilter(SerializableBiFunction) - * - * @return a data provider with a configurable filter, not null - */ - public default ConfigurableFilterDataProvider withConfigurableFilter() { - return withConfigurableFilter((configuredFilter, queryFilter) -> { - assert queryFilter == null : "Filter from Void query must be null"; - - return configuredFilter; - }); - } } -- cgit v1.2.3