Package com.vaadin.flow.data.provider
Class ConfigurableFilterDataProviderWrapper<T,Q,C,F>
java.lang.Object
com.vaadin.flow.data.provider.DataProviderWrapper<T,Q,F>
com.vaadin.flow.data.provider.ConfigurableFilterDataProviderWrapper<T,Q,C,F>
- Type Parameters:
T- the data provider item typeQ- the query filter typeC- the configurable filter typeF- the filter type of the wrapped data provider
- All Implemented Interfaces:
ConfigurableFilterDataProvider<T,,Q, C> DataProvider<T,,Q> Serializable
public abstract class ConfigurableFilterDataProviderWrapper<T,Q,C,F>
extends DataProviderWrapper<T,Q,F>
implements ConfigurableFilterDataProvider<T,Q,C>
A configurable data provider that wraps another data provider by combining
any filter from the component with the configured filter and passing that to
the wrapped provider through the query.
- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
-
Field Summary
Fields inherited from class com.vaadin.flow.data.provider.DataProviderWrapper
dataProvider -
Constructor Summary
ConstructorsConstructorDescriptionConfigurableFilterDataProviderWrapper(DataProvider<T, F> dataProvider) Creates a new configurable filter data provider by wrapping an existing data provider. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract FcombineFilters(Q queryFilter, C configuredFilter) Combines the configured filter and the filter from the query into one filter instance that can be passed to the wrapped data provider.protected FGets the filter that should be used in the modified Query.voidSets the filter to use for all queries handled by this data provider.toString()Methods inherited from class com.vaadin.flow.data.provider.DataProviderWrapper
addDataProviderListener, fetch, getId, isInMemory, refreshAll, refreshItem, sizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.vaadin.flow.data.provider.DataProvider
addDataProviderListener, fetch, getId, isInMemory, refreshAll, refreshItem, refreshItem, size, withConfigurableFilter, withConfigurableFilter, withConvertedFilter
-
Constructor Details
-
ConfigurableFilterDataProviderWrapper
Creates a new configurable filter data provider by wrapping an existing data provider.- Parameters:
dataProvider- the data provider to wrap, notnull
-
-
Method Details
-
getFilter
Description copied from class:DataProviderWrapperGets the filter that should be used in the modified Query.- Specified by:
getFilterin classDataProviderWrapper<T,Q, F> - Parameters:
query- the current query- Returns:
- filter for the modified Query
-
combineFilters
Combines the configured filter and the filter from the query into one filter instance that can be passed to the wrapped data provider. Will not be called if the configured filter isnulland the query has no filter.- Parameters:
queryFilter- the filter received through the query, ornullif no filter was provided in the queryconfiguredFilter- the filter that this data provider is configured to use, ornullif no filter has been configured- Returns:
- a filter that combines the two provided queries, or
nullto not pass any filter to the wrapped data provider
-
setFilter
Description copied from interface:ConfigurableFilterDataProviderSets the filter to use for all queries handled by this data provider.- Specified by:
setFilterin interfaceConfigurableFilterDataProvider<T,Q, C> - Parameters:
filter- the filter to set, ornullto clear any previously set filter
-
toString
- Overrides:
toStringin classDataProviderWrapper<T,Q, F>
-