public final class SliceUtil extends Object
Modifier and Type | Method and Description |
---|---|
static <T> void |
sliceAndExecute(T[] elements,
int sliceSize,
Consumer<T[]> consumer)
Cut array into slices of a given size and call consumer on each of them.
|
public static <T> void sliceAndExecute(T[] elements, int sliceSize, Consumer<T[]> consumer)
T
- the type of the elements.elements
- the array to be sliced.sliceSize
- the max size of a slice.consumer
- the consumer to be called on every slice.Copyright © 2020 Pivotal Software, Inc.. All rights reserved.