Interface Collector<T,​U>

  • Type Parameters:
    T - collected items type (input)
    U - result container type (output)

    public interface Collector<T,​U>
    A collector accumulates the items provided when collect(java.lang.Object) is invoked and makes them available in a single container object with value().
    • Method Detail

      • collect

        void collect​(T item)
        Collect the given item.
        Parameters:
        item - item to collect
      • value

        U value()
        Get the collected items container.
        Returns:
        U