Package com.vaadin.flow.data.provider
Class FilterUtils
java.lang.Object
com.vaadin.flow.data.provider.FilterUtils
Internal filter related utilities for data provider.
- Since:
- 1.3
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptionstatic <F,
Q, C> F combineFilters
(SerializableBiFunction<Q, C, F> filterCombiner, 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 using thefilterCombiner
.static <T,
C, F> F convertFilter
(SerializableFunction<C, F> filterConverter, Query<T, C> query) Gets the filter converted from a query filter by thefilterConverter
.
-
Method Details
-
combineFilters
public static <F,Q, F combineFiltersC> (SerializableBiFunction<Q, C, F> filterCombiner, 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 using thefilterCombiner
.- Type Parameters:
F
- the filter type of the wrapped data providerQ
- the query filter typeC
- the configurable filter type- Parameters:
filterCombiner
- a filters combinerqueryFilter
- a query filterconfiguredFilter
- a configured filter- Returns:
- a filters combination
-
convertFilter
public static <T,C, F convertFilterF> (SerializableFunction<C, F> filterConverter, Query<T, C> query) Gets the filter converted from a query filter by thefilterConverter
.- Type Parameters:
T
- data typeC
- the filter type that the wrapped data provider accepts; typically provided by a ComponentF
- the filter type of data provider- Parameters:
filterConverter
- callback that converts the filter in the query of the wrapped data provider into a filter supported by this data provider. Will only be called if the query contains a filter. Notnull
query
- a query with a filter to convert- Returns:
- a converted filter, may be
null
if the query has no filter
-