Package com.vaadin.flow.data.provider
Class FilterUtils
- java.lang.Object
-
- com.vaadin.flow.data.provider.FilterUtils
-
public final class FilterUtils extends Object
Internal filter related utilities for data provider.- Since:
- 1.3
- Author:
- Vaadin Ltd
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <F,Q,C>
FcombineFilters(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>
FconvertFilter(SerializableFunction<C,F> filterConverter, Query<T,C> query)
Gets the filter converted from a query filter by thefilterConverter
.
-
-
-
Method Detail
-
combineFilters
public static <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
.- 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> F convertFilter(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
-
-