Class FilterUtils


  • public final class FilterUtils
    extends Object
    Internal filter related utilities for data provider.
    Since:
    1.3
    Author:
    Vaadin Ltd
    • 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 the filterCombiner.
        Type Parameters:
        F - the filter type of the wrapped data provider
        Q - the query filter type
        C - the configurable filter type
        Parameters:
        filterCombiner - a filters combiner
        queryFilter - a query filter
        configuredFilter - 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 the filterConverter.
        Type Parameters:
        T - data type
        C - the filter type that the wrapped data provider accepts; typically provided by a Component
        F - 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. Not null
        query - a query with a filter to convert
        Returns:
        a converted filter, may be null if the query has no filter