Java Stream Operation toList(final Stream stream)

Here you can find the source of toList(final Stream stream)

Description

to List

License

Apache License

Return

this monad converted to a list

Declaration

public final static <T> List<T> toList(final Stream<T> stream) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.List;

import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Main {
    /**//from ww  w. j ava  2  s  .  c  o m
     * @return this monad converted to a list
     */
    public final static <T> List<T> toList(final Stream<T> stream) {

        return stream.collect(Collectors.toList());
    }
}

Related

  1. reverse(Stream stream)
  2. reverse(Stream input)
  3. startsWith(Stream stream, Iterable iterable)
  4. startsWith(Stream stream, Stream stream2)
  5. stringPositions(StringBuilder toTest, Stream strings)
  6. toParameter(Stream input, Class exp)
  7. toString(IntStream s)
  8. toString(LongStream ls)
  9. upcastStream(Stream stream)