com.holonplatform.vaadin.data

## Interface ItemDataProvider<ITEM>

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

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

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

- - ### Method Summary

    All Methods Static Methods Instance 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 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.
    `static <ITEM> ItemDataProvider<ITEM>` | `create(ItemSetCounter counter, ItemSetLoader<ITEM> loader, ItemRefresher<ITEM> refresher)` Create an `ItemDataProvider` using given operations.
    `default ITEM` | `refresh(ITEM item)` Refresh given item from concrete data store.

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

      `size`

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

      `load`

- - ### Method Detail

    - #### refresh

          default ITEM refresh(ITEM item)
                        throws UnsupportedOperationException,
                               com.holonplatform.core.exceptions.DataAccessException

      Description copied from interface: `ItemRefresher`
      Refresh given item from concrete data store.
      Specified by:
        `refresh` in interface `ItemRefresher<ITEM>`
      Parameters:
        `item` - Item to refresh (not null)
      Returns:
        Refreshed item
      Throws:
        `UnsupportedOperationException` - If the refresh operation is not supported by concrete implementation
        `com.holonplatform.core.exceptions.DataAccessException` - Error accessing underlying data store

    - #### 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 <ITEM> ItemDataProvider<ITEM> create(ItemSetCounter counter,
                                                      ItemSetLoader<ITEM> loader,
                                                      ItemRefresher<ITEM> refresher)

      Create an `ItemDataProvider` using given operations.
      Type Parameters:
        `ITEM` - Item data type
      Parameters:
        `counter` - Items counter (not null)
        `loader` - Items loader (not null)
        `refresher` - Item refresher
      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

    - #### 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 © 2017 The Holon Platform. All rights reserved.