Interface BatchResultIterable<T>
- Type Parameters:
T- The generic type for the iterable.
- All Superinterfaces:
Iterable<T>, ResultIterable<T>
Extend the
ResultIterable for batch operations.-
Nested Class Summary
Nested classes/interfaces inherited from interface ResultIterable
ResultIterable.ResultIteratorDelegate<T,R> Modifier and TypeInterfaceDescriptionstatic classAn implementation ofResultIteratorthat delegates calls to the iterator provided in the constructor. -
Method Summary
Modifier and TypeMethodDescriptionSplit the results into per-batch sub-lists.static <U> BatchResultIterable<U> of(ResultIterable<U> delegate, Supplier<int[]> modifiedRowCountsSupplier) Methods inherited from interface Iterable
spliteratorMethods inherited from interface ResultIterable
collect, collectInto, collectInto, collectIntoList, collectIntoSet, collectToMap, filter, findFirst, findOne, findOnly, first, forEach, forEachWithCount, iterator, list, map, one, reduce, set, stream, toCollection, useIterator, useStream, withIterator, withStreamModifier and TypeMethodDescriptiondefault <R> RCollect the results into a container specified by a collector.default <R> RcollectInto(Type containerType) Collect the results into a container type.default <R> RcollectInto(GenericType<R> containerType) Collect the results into a collection type.Returns results in aList.Returns results in aSet.default <K,V> Map <K, V> collectToMap(Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction) Collect the results into a Map, using the given functions to compute keys and values.default ResultIterable<T> Convenience method to filter theResultIterableby applying the specifiedPredicate.
This method has the look and feel ofStream.filter(Predicate)without making use of streams.Returns the first row in the result set, if present.findOne()Returns the only row in the result set, if any.default TfindOnly()Deprecated, for removal: This API element is subject to removal in a future version.default Tfirst()Returns the first row in the result set.default voiddefault intforEachWithCount(Consumer<? super T> action) Performs the specified action on each remaining element and returns the iteration i.e. record count.
It is often useful (e.g. for logging) to know the record count while processing result sets.iterator()Stream all the rows of the result set out with anIterator.list()Returns results in aListusing the JDK specific default implementation ofListas provided byCollectors.toList().default <R> ResultIterable<R> Returns aResultIterable<U>derived from thisResultIterable<T>, by transforming elements using the given mapper function.default Tone()Returns the only row in the result set.default <U> Ureduce(U identity, BiFunction<U, T, U> accumulator) Reduce the results.set()Returns results in aSetusing the JDK specific default implementation ofSetas provided byCollectors.toSet().stream()Returns the stream of results.default <C extends Collection<T>>
CtoCollection(Supplier<C> supplier) Collect the results into a collection object similar toCollectors.toCollection(Supplier).default <X extends Exception>
voiduseIterator(IteratorConsumer<T, X> consumer) Passes the iterator of results to the consumer.default <X extends Exception>
voiduseStream(StreamConsumer<T, X> consumer) Passes the stream of results to the consumer.default <R, X extends Exception>
RwithIterator(IteratorCallback<T, R, X> callback) Passes the iterator of results to the callback.default <R, X extends Exception>
RwithStream(StreamCallback<T, R, X> callback) Passes the stream of results to the callback.
-
Method Details
-
listPerBatch
-
of
static <U> BatchResultIterable<U> of(ResultIterable<U> delegate, Supplier<int[]> modifiedRowCountsSupplier)
-
ResultIterable.one()orResultIterable.findOne()instead.