Interface HasItems<T>

    • Method Detail

      • 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(Collection)
      • 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:
        setItems(Collection)