Interface FlowCompleted<T>

  • All Superinterfaces:
    Flow<T>, java.lang.Iterable<T>, java.util.Iterator<T>

    public interface FlowCompleted<T>
    extends Flow<T>
    • Method Detail

      • count

        int count()
        Description copied from interface: Flow
        Counts the number of elements in the flow.
        Specified by:
        count in interface Flow<T>
        Returns:
        the element count
      • random

        default T random()
        Description copied from interface: Flow
        Returns a random element from the flow.
        Specified by:
        random in interface Flow<T>
        Returns:
        a random element or null if flow is empty
      • toList

        @NotNull
        default @NotNull java.util.List<T> toList()
        Description copied from interface: Flow
        Collects elements into a list.
        Specified by:
        toList in interface Flow<T>
        Returns:
        a new list containing all elements
      • toMap

        @NotNull
        default <K,​V> @NotNull java.util.Map<K,​V> toMap​(AFunction<T,​K> keyFactory,
                                                                    AFunction<T,​V> valFactory)
        Description copied from interface: Flow
        Collects elements into a map using key and value extraction functions.
        Specified by:
        toMap in interface Flow<T>
        Type Parameters:
        K - the key type
        V - the value type
        Parameters:
        keyFactory - function to extract map keys from elements
        valFactory - function to extract map values from elements
        Returns:
        a new map with extracted keys and values
      • toArray

        @NotNull
        default @NotNull T[] toArray​(@NotNull
                                     @NotNull java.lang.Class<? super T> arrayType)
        Description copied from interface: Flow
        Collects elements into an array of the specified type.
        Specified by:
        toArray in interface Flow<T>
        Parameters:
        arrayType - the component type of the array
        Returns:
        an array containing all elements of this flow
      • toArray

        @NotNull
        default @NotNull java.lang.Object[] toArray()
        Description copied from interface: Flow
        Collects elements into an object array.
        Specified by:
        toArray in interface Flow<T>
        Returns:
        an array containing all elements