Package org.openl.util
Class StreamUtils
java.lang.Object
org.openl.util.StreamUtils
Set of utilities for Java Streams.
- Author:
- Yury Molchan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Stream<T> fromIterator(Iterator<T> iterator) Transform iterator to stream.toLinkedMap(Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends U> valueMapper) To use with Java Streams to collect in in a map preserving the order of elements.toTreeSet(Comparator<? super T> comparator) To use with Java Streams to collect in tree set with custom order
-
Constructor Details
-
StreamUtils
public StreamUtils()
-
-
Method Details
-
toLinkedMap
public static <T,K, Collector<T,U> ?, toLinkedMapMap<K, U>> (Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends U> valueMapper) To use with Java Streams to collect in in a map preserving the order of elements. -
toTreeSet
To use with Java Streams to collect in tree set with custom order -
fromIterator
Transform iterator to stream.- Type Parameters:
T- type of elements- Parameters:
iterator- iterator to transform- Returns:
- stream
-