Package org.springframework.data.support
Class WindowIterator<T>
java.lang.Object
org.springframework.data.support.WindowIterator<T>
- All Implemented Interfaces:
- 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
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescriptionbooleanhasNext()next()static <T> WindowIterator.WindowIteratorBuilder<T>of(Function<ScrollPosition, Window<T>> windowFunction) Entrypoint to create a newWindowIteratorfor the given windowFunction.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.IteratorforEachRemaining, remove
- 
Method Details- 
ofpublic static <T> WindowIterator.WindowIteratorBuilder<T> of(Function<ScrollPosition, Window<T>> windowFunction) Entrypoint to create a newWindowIteratorfor the given windowFunction.- Type Parameters:
- T-
- Parameters:
- windowFunction- must not be null.
- Returns:
- new instance of WindowIterator.WindowIteratorBuilder.
 
- 
hasNextpublic boolean hasNext()
- 
next
 
-