Class LegacyStreamExtensions
java.lang.Object
ru.progrm_jarvis.javacommons.util.stream.extension.LegacyStreamExtensions
Extensions to provide new
Stream methods on older Java versions.-
Method Summary
-
Method Details
-
toList
@NotNull public static <T> @NotNull @Unmodifiable List<T> toList(@NotNull @NotNull @Own Stream<?> stream) Returns an immutable list containing the elements of the stream.
This is a terminal operation
- Type Parameters:
T- type of stream's elements- Parameters:
stream- stream to convert into the list- Returns:
- an unmodifiable list consisting os this stream's elements
- API note
- this method is available on
Streamitself since Java 16
-