Class ConfigurableFilterDataProviderWrapper<T,​Q,​C,​F>

  • Type Parameters:
    T - the data provider item type
    Q - the query filter type
    C - the configurable filter type
    F - 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:
    Serialized Form
    • Constructor Detail

      • ConfigurableFilterDataProviderWrapper

        public ConfigurableFilterDataProviderWrapper​(DataProvider<T,​F> dataProvider)
        Creates a new configurable filter data provider by wrapping an existing data provider.
        Parameters:
        dataProvider - the data provider to wrap, not null
    • Method Detail

      • getFilter

        protected F getFilter​(Query<T,​Q> query)
        Description copied from class: DataProviderWrapper
        Gets the filter that should be used in the modified Query.
        Specified by:
        getFilter in class DataProviderWrapper<T,​Q,​F>
        Parameters:
        query - the current query
        Returns:
        filter for the modified Query
      • combineFilters

        protected 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. Will not be called if the configured filter is null and the query has no filter.
        Parameters:
        queryFilter - the filter received through the query, or null if no filter was provided in the query
        configuredFilter - the filter that this data provider is configured to use, or null 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