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
ConstructorDescriptionConfigurableFilterDataProviderWrapper
(DataProvider<T, F> dataProvider) Creates a new configurable filter data provider by wrapping an existing data provider. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract F
combineFilters
(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 F
Gets the filter that should be used in the modified Query.void
Sets 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, size
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:DataProviderWrapper
Gets the filter that should be used in the modified Query.- Specified by:
getFilter
in 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 isnull
and the query has no filter.- Parameters:
queryFilter
- the filter received through the query, ornull
if no filter was provided in the queryconfiguredFilter
- the filter that this data provider is configured to use, ornull
if no filter has been configured- Returns:
- a filter that combines the two provided queries, or
null
to not pass any filter to the wrapped data provider
-
setFilter
Description copied from interface:ConfigurableFilterDataProvider
Sets the filter to use for all queries handled by this data provider.- Specified by:
setFilter
in interfaceConfigurableFilterDataProvider<T,
Q, C> - Parameters:
filter
- the filter to set, ornull
to clear any previously set filter
-
toString
- Overrides:
toString
in classDataProviderWrapper<T,
Q, F>
-