com.holonplatform.vaadin.flow.data

## Interface DatastoreDataProvider<T,F>

- Type Parameters:
    `T` - Data type
    `F` - Query filter type
  All Superinterfaces:
    com.vaadin.flow.data.provider.DataProvider<T,F>, Serializable

      public interface DatastoreDataProvider<T,F>
      extends com.vaadin.flow.data.provider.DataProvider<T,F>

  A `DataProvider` which uses a `Datastore` for fetching data from a backend.
  Since:
    5.2.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `DatastoreDataProvider.Builder<T,F>` `DatastoreDataProvider` builder.
    `static interface` | `DatastoreDataProvider.PropertyBoxItemBuilder<F>` A `DatastoreDataProvider` with `PropertyBox` items type builder.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addQueryConfigurationProvider(com.holonplatform.core.query.QueryConfigurationProvider queryConfigurationProvider)` Add a `QueryConfigurationProvider`.
    `static <P extends com.holonplatform.core.property.Property> com.holonplatform.core.property.PropertySet<?>` | `asPropertySet(Iterable<P> properties)` Convert given properties into a `PropertySet`.
    `static com.holonplatform.core.property.PropertySet<?>` | `asPropertySet(com.holonplatform.core.property.Property<?>... properties)` Convert given properties into a `PropertySet`.
    `static <T> DatastoreDataProvider.Builder<T,com.holonplatform.core.query.QueryFilter>` | `builder(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, Class<T> beanType)` Get a builder to create and configure a new `DatastoreDataProvider` using given `beanType` as item type and `QueryFilter` type data provider filters.
    `static <T,F> DatastoreDataProvider.Builder<T,F>` | `builder(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, Class<T> beanType, Function<F,com.holonplatform.core.query.QueryFilter> filterConverter)` Get a builder to create and configure a new `DatastoreDataProvider` using given `beanType` as item type.
    `static <F> DatastoreDataProvider.PropertyBoxItemBuilder<F>` | `builder(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, Function<F,com.holonplatform.core.query.QueryFilter> filterConverter, com.holonplatform.core.property.Property<?>... properties)` Get a builder to create and configure a new `DatastoreDataProvider` which uses `PropertyBox` items type.
    `static DatastoreDataProvider.PropertyBoxItemBuilder<com.holonplatform.core.query.QueryFilter>` | `builder(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, com.holonplatform.core.property.Property<?>... properties)` Get a builder to create and configure a new `DatastoreDataProvider` which uses `PropertyBox` items type and `QueryFilter` type data provider filters.
    `static DatastoreDataProvider.PropertyBoxItemBuilder<com.holonplatform.core.query.QueryFilter>` | `builder(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, com.holonplatform.core.property.PropertySet<?> propertySet)` Get a builder to create and configure a new `DatastoreDataProvider` which uses `PropertyBox` items type and `QueryFilter` type data provider filters.
    `static <F> DatastoreDataProvider.PropertyBoxItemBuilder<F>` | `builder(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, com.holonplatform.core.property.PropertySet<?> propertySet, Function<F,com.holonplatform.core.query.QueryFilter> filterConverter)` Get a builder to create and configure a new `DatastoreDataProvider` which uses `PropertyBox` items type.
    `static <T,F> DatastoreDataProvider.Builder<T,F>` | `builder(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, com.holonplatform.core.property.PropertySet<?> propertySet, Function<com.holonplatform.core.property.PropertyBox,T> itemConverter, Function<F,com.holonplatform.core.query.QueryFilter> filterConverter)` Get a builder to create and configure a new `DatastoreDataProvider`.
    `static <T> DatastoreDataProvider<T,com.holonplatform.core.query.QueryFilter>` | `create(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, Class<T> beanType)` Create a new `DatastoreDataProvider` which uses given `beanType` as items type and `QueryFilter` type data provider filters.
    `static <T,F> DatastoreDataProvider<T,F>` | `create(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, Class<T> beanType, Function<F,com.holonplatform.core.query.QueryFilter> filterConverter)` Create a new `DatastoreDataProvider` which uses given `beanType` as items type.
    `static <F> DatastoreDataProvider<com.holonplatform.core.property.PropertyBox,F>` | `create(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, Function<F,com.holonplatform.core.query.QueryFilter> filterConverter, com.holonplatform.core.property.Property<?>... properties)` Create a new `DatastoreDataProvider` which uses `PropertyBox` items type.
    `static DatastoreDataProvider<com.holonplatform.core.property.PropertyBox,com.holonplatform.core.query.QueryFilter>` | `create(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, com.holonplatform.core.property.Property<?>... properties)` Create a new `DatastoreDataProvider` which uses `PropertyBox` items type and `QueryFilter` type data provider filters.
    `static DatastoreDataProvider<com.holonplatform.core.property.PropertyBox,com.holonplatform.core.query.QueryFilter>` | `create(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, com.holonplatform.core.property.PropertySet<?> propertySet)` Create a new `DatastoreDataProvider` which uses `PropertyBox` items type and `QueryFilter` type data provider filters.
    `static <F> DatastoreDataProvider<com.holonplatform.core.property.PropertyBox,F>` | `create(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, com.holonplatform.core.property.PropertySet<?> propertySet, Function<F,com.holonplatform.core.query.QueryFilter> filterConverter)` Create a new `DatastoreDataProvider` which uses `PropertyBox` items type.
    `static <T,F> DatastoreDataProvider<T,F>` | `create(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, com.holonplatform.core.property.PropertySet<?> propertySet, Function<com.holonplatform.core.property.PropertyBox,T> itemConverter, Function<F,com.holonplatform.core.query.QueryFilter> filterConverter)` Create a new `DatastoreDataProvider`.
    `Optional<com.holonplatform.core.query.QuerySort>` | `getDefaultSort()` Get the default query sort, if available.
    `Function<F,com.holonplatform.core.query.QueryFilter>` | `getFilterConverter()` Get the function to use to convert the data provider filter type to a `QueryFilter` type.
    `Optional<Function<T,Object>>` | `getItemIdentifier()` Get the item identifier function, if available.
    `Set<com.holonplatform.core.query.QueryConfigurationProvider>` | `getQueryConfigurationProviders()` Get the `QueryConfigurationProvider`s.
    `Function<com.vaadin.flow.data.provider.QuerySortOrder,com.holonplatform.core.query.QuerySort>` | `getQuerySortOrderConverter()` Get the function to use to convert a `QuerySortOrder` declaration into a `QuerySort`.
    `void` | `setDefaultSort(com.holonplatform.core.query.QuerySort defaultSort)` Set the default query sort.
    `void` | `setFilterConverter(Function<F,com.holonplatform.core.query.QueryFilter> filterConverter)` Set the function to use to convert the data provider filter type to a `QueryFilter` type.
    `void` | `setItemIdentifier(Function<T,Object> itemIdentifier)` Set the item identifier function.
    `void` | `setQuerySortOrderConverter(Function<com.vaadin.flow.data.provider.QuerySortOrder,com.holonplatform.core.query.QuerySort> querySortOrderConverter)` Set the function to use to convert a `QuerySortOrder` declaration into a `QuerySort`.

    - ### Methods inherited from interface com.vaadin.flow.data.provider.DataProvider

      `addDataProviderListener, fetch, fromCallbacks, fromFilteringCallbacks, fromStream, getId, isInMemory, ofCollection, ofItems, refreshAll, refreshItem, size, withConfigurableFilter, withConfigurableFilter, withConvertedFilter`

- - ### Method Detail

    - #### getItemIdentifier

          Optional<Function<T,Object>> getItemIdentifier()

      Get the item identifier function, if available.
      Returns:
        Optional item identifier function

    - #### setItemIdentifier

          void setItemIdentifier(Function<T,Object> itemIdentifier)

      Set the item identifier function.
      Parameters:
        `itemIdentifier` - the item identifier function to set

    - #### getQueryConfigurationProviders

          Set<com.holonplatform.core.query.QueryConfigurationProvider> getQueryConfigurationProviders()

      Get the `QueryConfigurationProvider`s.
      Returns:
        the query configuration providers, empty if none

    - #### addQueryConfigurationProvider

          void addQueryConfigurationProvider(com.holonplatform.core.query.QueryConfigurationProvider queryConfigurationProvider)

      Add a `QueryConfigurationProvider`.
      Parameters:
        `queryConfigurationProvider` - The `QueryConfigurationProvider` to add (not null)

    - #### getDefaultSort

          Optional<com.holonplatform.core.query.QuerySort> getDefaultSort()

      Get the default query sort, if available.
      Returns:
        Optional default query sort

    - #### setDefaultSort

          void setDefaultSort(com.holonplatform.core.query.QuerySort defaultSort)

      Set the default query sort.
      Parameters:
        `defaultSort` - the default query sort to set

    - #### getQuerySortOrderConverter

          Function<com.vaadin.flow.data.provider.QuerySortOrder,com.holonplatform.core.query.QuerySort> getQuerySortOrderConverter()

      Get the function to use to convert a `QuerySortOrder` declaration into a `QuerySort`.
      Returns:
        the `QuerySortOrder` converter function

    - #### setQuerySortOrderConverter

          void setQuerySortOrderConverter(Function<com.vaadin.flow.data.provider.QuerySortOrder,com.holonplatform.core.query.QuerySort> querySortOrderConverter)

      Set the function to use to convert a `QuerySortOrder` declaration into a `QuerySort`.
      Parameters:
        `querySortOrderConverter` - the query sort order converter to set (not null)

    - #### getFilterConverter

          Function<F,com.holonplatform.core.query.QueryFilter> getFilterConverter()

      Get the function to use to convert the data provider filter type to a `QueryFilter` type.
      Returns:
        The filter converter

    - #### setFilterConverter

          void setFilterConverter(Function<F,com.holonplatform.core.query.QueryFilter> filterConverter)

      Set the function to use to convert the data provider filter type to a `QueryFilter` type.
      Parameters:
        `filterConverter` - The filter converter to set (not null)

    - #### create

          static DatastoreDataProvider<com.holonplatform.core.property.PropertyBox,com.holonplatform.core.query.QueryFilter> create(com.holonplatform.core.datastore.Datastore datastore,
                                                                                                                                    com.holonplatform.core.datastore.DataTarget<?> target,
                                                                                                                                    com.holonplatform.core.property.PropertySet<?> propertySet)

      Create a new `DatastoreDataProvider` which uses `PropertyBox` items type and `QueryFilter` type data provider filters.
      Parameters:
        `datastore` - The `Datastore` to use (not null)
        `target` - The `DataTarget` to use as query target (not null)
        `propertySet` - The property set to use as query projection (not null)
      Returns:
        A new `DatastoreDataProvider`

    - #### create

          static DatastoreDataProvider<com.holonplatform.core.property.PropertyBox,com.holonplatform.core.query.QueryFilter> create(com.holonplatform.core.datastore.Datastore datastore,
                                                                                                                                    com.holonplatform.core.datastore.DataTarget<?> target,
                                                                                                                                    com.holonplatform.core.property.Property<?>... properties)

      Create a new `DatastoreDataProvider` which uses `PropertyBox` items type and `QueryFilter` type data provider filters.
      Parameters:
        `datastore` - The `Datastore` to use (not null)
        `target` - The `DataTarget` to use as query target (not null)
        `properties` - The property set to use as query projection (not null)
      Returns:
        A new `DatastoreDataProvider`

    - #### create

          static <F> DatastoreDataProvider<com.holonplatform.core.property.PropertyBox,F> create(com.holonplatform.core.datastore.Datastore datastore,
                                                                                                 com.holonplatform.core.datastore.DataTarget<?> target,
                                                                                                 com.holonplatform.core.property.PropertySet<?> propertySet,
                                                                                                 Function<F,com.holonplatform.core.query.QueryFilter> filterConverter)

      Create a new `DatastoreDataProvider` which uses `PropertyBox` items type.
      Type Parameters:
        `F` - Query filter type
      Parameters:
        `datastore` - The `Datastore` to use (not null)
        `target` - The `DataTarget` to use as query target (not null)
        `propertySet` - The property set to use as query projection (not null)
        `filterConverter` - The function to use to convert the data provider filters into a `QueryFilter` (not null)
      Returns:
        A new `DatastoreDataProvider`

    - #### create

          static <F> DatastoreDataProvider<com.holonplatform.core.property.PropertyBox,F> create(com.holonplatform.core.datastore.Datastore datastore,
                                                                                                 com.holonplatform.core.datastore.DataTarget<?> target,
                                                                                                 Function<F,com.holonplatform.core.query.QueryFilter> filterConverter,
                                                                                                 com.holonplatform.core.property.Property<?>... properties)

      Create a new `DatastoreDataProvider` which uses `PropertyBox` items type.
      Type Parameters:
        `F` - Query filter type
      Parameters:
        `datastore` - The `Datastore` to use (not null)
        `target` - The `DataTarget` to use as query target (not null)
        `properties` - The property set to use as query projection (not null)
        `filterConverter` - The function to use to convert the data provider filters into a `QueryFilter` (not null)
      Returns:
        A new `DatastoreDataProvider`

    - #### create

          static <T> DatastoreDataProvider<T,com.holonplatform.core.query.QueryFilter> create(com.holonplatform.core.datastore.Datastore datastore,
                                                                                              com.holonplatform.core.datastore.DataTarget<?> target,
                                                                                              Class<T> beanType)

      Create a new `DatastoreDataProvider` which uses given `beanType` as items type and `QueryFilter` type data provider filters.
      Type Parameters:
        `T` - Bean type
      Parameters:
        `datastore` - The `Datastore` to use (not null)
        `target` - The `DataTarget` to use as query target (not null)
        `beanType` - The bean class (not null)
      Returns:
        A new `DatastoreDataProvider`

    - #### create

          static <T,F> DatastoreDataProvider<T,F> create(com.holonplatform.core.datastore.Datastore datastore,
                                                         com.holonplatform.core.datastore.DataTarget<?> target,
                                                         Class<T> beanType,
                                                         Function<F,com.holonplatform.core.query.QueryFilter> filterConverter)

      Create a new `DatastoreDataProvider` which uses given `beanType` as items type.
      Type Parameters:
        `T` - Bean type
        `F` - Query filter type
      Parameters:
        `datastore` - The `Datastore` to use (not null)
        `target` - The `DataTarget` to use as query target (not null)
        `beanType` - The bean class (not null)
        `filterConverter` - The function to use to convert the data provider filters into a `QueryFilter` (not null)
      Returns:
        A new `DatastoreDataProvider`

    - #### create

          static <T,F> DatastoreDataProvider<T,F> create(com.holonplatform.core.datastore.Datastore datastore,
                                                         com.holonplatform.core.datastore.DataTarget<?> target,
                                                         com.holonplatform.core.property.PropertySet<?> propertySet,
                                                         Function<com.holonplatform.core.property.PropertyBox,T> itemConverter,
                                                         Function<F,com.holonplatform.core.query.QueryFilter> filterConverter)

      Create a new `DatastoreDataProvider`.
      Type Parameters:
        `T` - Data type
        `F` - Query filter type
      Parameters:
        `datastore` - The `Datastore` to use (not null)
        `target` - The `DataTarget` to use as query target (not null)
        `propertySet` - The property set to use as query projection (not null)
        `itemConverter` - The function to use to convert the Datastore `PropertyBox` type results into the required item type (not null)
        `filterConverter` - The function to use to convert the data provider filters into a `QueryFilter` (not null)
      Returns:
        A new `DatastoreDataProvider`

    - #### builder

          static DatastoreDataProvider.PropertyBoxItemBuilder<com.holonplatform.core.query.QueryFilter> builder(com.holonplatform.core.datastore.Datastore datastore,
                                                                                                                com.holonplatform.core.datastore.DataTarget<?> target,
                                                                                                                com.holonplatform.core.property.PropertySet<?> propertySet)

      Get a builder to create and configure a new `DatastoreDataProvider` which uses `PropertyBox` items type and `QueryFilter` type data provider filters.
      Parameters:
        `datastore` - The `Datastore` to use (not null)
        `target` - The `DataTarget` to use as query target (not null)
        `propertySet` - The property set to use as query projection (not null)
      Returns:
        a new `DatastoreDataProvider` builder

    - #### builder

          static DatastoreDataProvider.PropertyBoxItemBuilder<com.holonplatform.core.query.QueryFilter> builder(com.holonplatform.core.datastore.Datastore datastore,
                                                                                                                com.holonplatform.core.datastore.DataTarget<?> target,
                                                                                                                com.holonplatform.core.property.Property<?>... properties)

      Get a builder to create and configure a new `DatastoreDataProvider` which uses `PropertyBox` items type and `QueryFilter` type data provider filters.
      Parameters:
        `datastore` - The `Datastore` to use (not null)
        `target` - The `DataTarget` to use as query target (not null)
        `properties` - The property set to use as query projection (not null)
      Returns:
        a new `DatastoreDataProvider` builder

    - #### builder

          static <F> DatastoreDataProvider.PropertyBoxItemBuilder<F> builder(com.holonplatform.core.datastore.Datastore datastore,
                                                                             com.holonplatform.core.datastore.DataTarget<?> target,
                                                                             com.holonplatform.core.property.PropertySet<?> propertySet,
                                                                             Function<F,com.holonplatform.core.query.QueryFilter> filterConverter)

      Get a builder to create and configure a new `DatastoreDataProvider` which uses `PropertyBox` items type.
      Type Parameters:
        `F` - Query filter type
      Parameters:
        `datastore` - The `Datastore` to use (not null)
        `target` - The `DataTarget` to use as query target (not null)
        `propertySet` - The property set to use as query projection (not null)
        `filterConverter` - The function to use to convert the data provider filters into a `QueryFilter` (not null)
      Returns:
        a new `DatastoreDataProvider` builder

    - #### builder

          static <F> DatastoreDataProvider.PropertyBoxItemBuilder<F> builder(com.holonplatform.core.datastore.Datastore datastore,
                                                                             com.holonplatform.core.datastore.DataTarget<?> target,
                                                                             Function<F,com.holonplatform.core.query.QueryFilter> filterConverter,
                                                                             com.holonplatform.core.property.Property<?>... properties)

      Get a builder to create and configure a new `DatastoreDataProvider` which uses `PropertyBox` items type.
      Type Parameters:
        `F` - Query filter type
      Parameters:
        `datastore` - The `Datastore` to use (not null)
        `target` - The `DataTarget` to use as query target (not null)
        `properties` - The property set to use as query projection (not null)
        `filterConverter` - The function to use to convert the data provider filters into a `QueryFilter` (not null)
      Returns:
        a new `DatastoreDataProvider` builder

    - #### builder

          static <T> DatastoreDataProvider.Builder<T,com.holonplatform.core.query.QueryFilter> builder(com.holonplatform.core.datastore.Datastore datastore,
                                                                                                       com.holonplatform.core.datastore.DataTarget<?> target,
                                                                                                       Class<T> beanType)

      Get a builder to create and configure a new `DatastoreDataProvider` using given `beanType` as item type and `QueryFilter` type data provider filters.

      The provided `beanType` class must be compliant with the JavaBeans specifications.

      Type Parameters:
        `T` - Bean type
      Parameters:
        `datastore` - The `Datastore` to use (not null)
        `target` - The `DataTarget` to use as query target (not null)
        `beanType` - The bean type (not null)
      Returns:
        a new `DatastoreDataProvider` builder

    - #### builder

          static <T,F> DatastoreDataProvider.Builder<T,F> builder(com.holonplatform.core.datastore.Datastore datastore,
                                                                  com.holonplatform.core.datastore.DataTarget<?> target,
                                                                  Class<T> beanType,
                                                                  Function<F,com.holonplatform.core.query.QueryFilter> filterConverter)

      Get a builder to create and configure a new `DatastoreDataProvider` using given `beanType` as item type.

      The provided `beanType` class must be compliant with the JavaBeans specifications.

      Type Parameters:
        `T` - Data type
        `F` - Query filter type
      Parameters:
        `datastore` - The `Datastore` to use (not null)
        `target` - The `DataTarget` to use as query target (not null)
        `beanType` - The bean type (not null)
        `filterConverter` - The function to use to convert the data provider filters into a `QueryFilter` (not null)
      Returns:
        a new `DatastoreDataProvider` builder

    - #### builder

          static <T,F> DatastoreDataProvider.Builder<T,F> builder(com.holonplatform.core.datastore.Datastore datastore,
                                                                  com.holonplatform.core.datastore.DataTarget<?> target,
                                                                  com.holonplatform.core.property.PropertySet<?> propertySet,
                                                                  Function<com.holonplatform.core.property.PropertyBox,T> itemConverter,
                                                                  Function<F,com.holonplatform.core.query.QueryFilter> filterConverter)

      Get a builder to create and configure a new `DatastoreDataProvider`.
      Type Parameters:
        `T` - Data type
        `F` - Query filter type
      Parameters:
        `datastore` - The `Datastore` to use (not null)
        `target` - The `DataTarget` to use as query target (not null)
        `propertySet` - The property set to use as query projection (not null)
        `itemConverter` - The function to use to convert the Datastore `PropertyBox` type results into the required item type (not null)
        `filterConverter` - The function to use to convert the data provider filters into a `QueryFilter` (not null)
      Returns:
        a new `DatastoreDataProvider` builder

    - #### asPropertySet

          static <P extends com.holonplatform.core.property.Property> com.holonplatform.core.property.PropertySet<?> asPropertySet(Iterable<P> properties)

      Convert given properties into a `PropertySet`.
      Type Parameters:
        `P` - Property type
      Parameters:
        `properties` - The properties to convert (not null)
      Returns:
        A `PropertySet` with given properties

    - #### asPropertySet

          static com.holonplatform.core.property.PropertySet<?> asPropertySet(com.holonplatform.core.property.Property<?>... properties)

      Convert given properties into a `PropertySet`.
      Parameters:
        `properties` - The properties to convert (not null)
      Returns:
        A `PropertySet` with given properties

Copyright © 2019 The Holon Platform. All rights reserved.