com.holonplatform.vaadin.data

## Interface ItemDataProvider<ITEM>

- Type Parameters:
    `ITEM` - Item data type
  All Superinterfaces:
    ItemSetCounter, ItemSetLoader<ITEM>, Serializable

      public interface ItemDataProvider<ITEM>
      extends ItemSetCounter, ItemSetLoader<ITEM>

  Iterface to load items data from a data source.
  Since:
    5.0.0

- - ### Method Summary

    All Methods Static Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T,ITEM> ItemDataProvider<T>` | `convert(ItemDataProvider<ITEM> provider, Function<ITEM,T> converter)` Create a new `ItemDataProvider` which wraps a concrete data provider and converts items into a different type using a converter function.
    `static <T> ItemDataProvider<T>` | `create(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, Class<T> beanClass)` Construct a `ItemDataProvider` using a `Datastore` and given `beanClass` as item type.
    `static <T> ItemDataProvider<T>` | `create(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, Class<T> beanClass, com.holonplatform.core.query.QueryConfigurationProvider... queryConfigurationProviders)` Construct a `ItemDataProvider` using a `Datastore` and given `beanClass` as item type.
    `static ItemDataProvider<com.holonplatform.core.property.PropertyBox>` | `create(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, com.holonplatform.core.property.PropertySet<?> propertySet)` Construct a `ItemDataProvider` using a `Datastore`.
    `static ItemDataProvider<com.holonplatform.core.property.PropertyBox>` | `create(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, com.holonplatform.core.property.PropertySet<?> propertySet, com.holonplatform.core.query.QueryConfigurationProvider... queryConfigurationProviders)` Construct a `ItemDataProvider` using a `Datastore`.
    `static <ITEM> ItemDataProvider<ITEM>` | `create(ItemSetCounter counter, ItemSetLoader<ITEM> loader)` Create an `ItemDataProvider` using given operations.

    - ### Methods inherited from interface com.holonplatform.vaadin.data.ItemSetCounter

      `size`

    - ### Methods inherited from interface com.holonplatform.vaadin.data.ItemSetLoader

      `load`

- - ### Method Detail

    - #### create

          static <ITEM> ItemDataProvider<ITEM> create(ItemSetCounter counter,
                                                      ItemSetLoader<ITEM> loader)

      Create an `ItemDataProvider` using given operations.
      Type Parameters:
        `ITEM` - Item data type
      Parameters:
        `counter` - Items counter (not null)
        `loader` - Items loader (not null)
      Returns:
        A new `ItemDataProvider` instance

    - #### create

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

      Construct a `ItemDataProvider` using a `Datastore`.
      Parameters:
        `datastore` - Datastore to use (not null)
        `target` - Data target (not null)
        `propertySet` - Property set to load
      Returns:
        the `ItemDataProvider` instance

    - #### create

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

      Construct a `ItemDataProvider` using a `Datastore`.
      Parameters:
        `datastore` - Datastore to use (not null)
        `target` - Data target (not null)
        `propertySet` - Property set to load
        `queryConfigurationProviders` - Optional additional `QueryConfigurationProvider`s
      Returns:
        the `ItemDataProvider` instance

    - #### create

          static <T> ItemDataProvider<T> create(com.holonplatform.core.datastore.Datastore datastore,
                                                com.holonplatform.core.datastore.DataTarget<?> target,
                                                Class<T> beanClass)

      Construct a `ItemDataProvider` using a `Datastore` and given `beanClass` as item type.

      The query projection will be configured using the bean class property names and the query results will be obtained as instances of given bean class. The default `BeanIntrospector` will be used to inspect bean class properties.

      Type Parameters:
        `T` - Bean type
      Parameters:
        `datastore` - Datastore to use (not null)
        `target` - Data target (not null)
        `beanClass` - Item bean type (not null)
      Returns:
        the `ItemDataProvider` instance

    - #### create

          static <T> ItemDataProvider<T> create(com.holonplatform.core.datastore.Datastore datastore,
                                                com.holonplatform.core.datastore.DataTarget<?> target,
                                                Class<T> beanClass,
                                                com.holonplatform.core.query.QueryConfigurationProvider... queryConfigurationProviders)

      Construct a `ItemDataProvider` using a `Datastore` and given `beanClass` as item type.

      The query projection will be configured using the bean class property names and the query results will be obtained as instances of given bean class. The default `BeanIntrospector` will be used to inspect bean class properties.

      Type Parameters:
        `T` - Bean type
      Parameters:
        `datastore` - Datastore to use (not null)
        `target` - Data target (not null)
        `beanClass` - Item bean type (not null)
        `queryConfigurationProviders` - Optional additional `QueryConfigurationProvider`s
      Returns:
        the `ItemDataProvider` instance

    - #### convert

          static <T,ITEM> ItemDataProvider<T> convert(ItemDataProvider<ITEM> provider,
                                                      Function<ITEM,T> converter)

      Create a new `ItemDataProvider` which wraps a concrete data provider and converts items into a different type using a converter function.
      Type Parameters:
        `ITEM` - Item type
        `T` - Converted type
      Parameters:
        `provider` - Concrete data privider (not null)
        `converter` - Converter function (not null)
      Returns:
        the data provider wrapper

Copyright © 2019 The Holon Platform. All rights reserved.