Class WindowIterator<T>

java.lang.Object
org.springframework.data.support.WindowIterator<T>
All Implemented Interfaces:
Iterator<T>

public class WindowIterator<T> extends Object implements Iterator<T>
An Iterator over multiple Windows obtained via a window function, that keeps track of the current ScrollPosition allowing scrolling across all result elements.
 WindowIterator<User> users = WindowIterator.of(position -> repository.findFirst10By…("spring", position))
   .startingAt(ScrollPosition.offset());

 while (users.hasNext()) {
   User u = users.next();
   // consume user
 }
 
Since:
3.1
Author:
Christoph Strobl, Mark Paluch