com.vaadin.flow.data.binder.

Interface HasItems<T>

Type Parameters:

T - the type of the displayed item

All Superinterfaces:

Serializable

All Known Subinterfaces:

HasDataProvider<T>, HasFilterableDataProvider<T,F>, HasItemsAndComponents<T>

All Known Implementing Classes:

VirtualList

public interface HasItems<T> extends Serializable

Mixin interface for components that displays a collection of items.

Note: this is gradually replaced by HasListDataView, HasLazyDataView and HasDataView in the components.

Since:

1.0

  • Method Summary

    Modifier and Type
    Method
    Description
    void

    Sets the data items of this component provided as a collection.

    default void
    setItems(Stream<T> streamOfItems)

    Sets the data items of this listing provided as a stream.

    default void
    setItems(T... items)

    Sets the data items of this listing.

  • Method Details

    • setItems

      void setItems(Collection<T> items)

      Sets the data items of this component provided as a collection.

      The provided collection instance may be used as-is. Subsequent modification of the collection might cause inconsistent data to be shown in the component unless it is explicitly instructed to read the data again.

      Parameters:

      items - the data items to display, not null

    • setItems

      default void setItems(T... items)

      Sets the data items of this listing.

      Parameters:

      items - the data items to display, the array must not be null

      See Also:

    • setItems

      default void setItems(Stream<T> streamOfItems)

      Sets the data items of this listing provided as a stream.

      This is just a shorthand for setItems(Collection), that collects objects in the stream to a list. Thus, using this method, instead of its array and Collection variations, doesn't save any memory.

      Parameters:

      streamOfItems - the stream of data items to display, not null

      See Also: