java.lang.Object
org.omnifaces.utils.stream.Collectors
-
Method Summary
Modifier and TypeMethodDescriptionfindLast()Returns a collector which will return the last element of a stream, if present.forEachBatch(Consumer<List<T>> batchConsumer, int batchSize) Returns a collector which takes the elements of the current stream and returns a new stream with the same elements in reverse order.static <T extends Comparable<T>>
Collector<T,?, Summary<T>> summary()summaryBy(Comparator<? super T> comparator) toLinkedMap(Function<? super T, ? extends K> keyMapper)
-
Method Details
-
toMap
-
toLinkedMap
-
toLinkedSet
-
forEachBatch
-
combine
-
reversedStream
Returns a collector which takes the elements of the current stream and returns a new stream with the same elements in reverse order.This collector will collect all elements from a stream into memory in order to return the reversed stream. As a result this collector may not be suitable for extremely large or infinite streams.
- Type Parameters:
T- The type of the elements- Returns:
- A Collector that returns the elements of a stream in reverse order.
-
findLast
Returns a collector which will return the last element of a stream, if present.- Type Parameters:
T- The type of the elements- Returns:
- An
Optionalcontaining the last element of the stream orOptional.empty()if the stream is empty.
-
summary
-
summaryBy
-