Package org.bitcoinj.base.internal
Class StreamUtils
- java.lang.Object
-
- org.bitcoinj.base.internal.StreamUtils
-
public class StreamUtils extends java.lang.Object
Stream Utilities. Bitcoinj is moving towards functional-style programming, immutable data structures, and unmodifiable lists. Since we are currently limited to Java 8, this class contains utility methods that can simplify code in many places.
-
-
Constructor Summary
Constructors Constructor Description StreamUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> java.util.stream.Collector<T,?,java.util.List<T>>
toUnmodifiableList()
Return a collector that collects aStream
into an unmodifiable list.
-
-
-
Method Detail
-
toUnmodifiableList
public static <T> java.util.stream.Collector<T,?,java.util.List<T>> toUnmodifiableList()
Return a collector that collects aStream
into an unmodifiable list.Java 10 provides
Collectors.toUnmodifiableList()
and Java 16 providesStream.toList()
. If those are not available, use this utility method.
-
-