Package com.okta.sdk.resource.client
Class PagedIterator<T>
java.lang.Object
com.okta.sdk.resource.client.PagedIterator<T>
- Type Parameters:
T- The type of item in the collection (e.g., User)
- All Implemented Interfaces:
Iterator<T>
The new stateful, but *isolated*, iterator for pagination.
This object is created for each loop and holds the state
(the next page URL and the current page's items) for that
loop *only*. It is not shared, making it thread-safe.
-
Constructor Summary
ConstructorsConstructorDescriptionPagedIterator(Function<String, ApiResponse<List<T>>> pageFetcher) Constructs a new PagedIterator with the given page fetching strategy. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
PagedIterator
Constructs a new PagedIterator with the given page fetching strategy.- Parameters:
pageFetcher- A function that takes a next URL (or null for the first page) and returns an ApiResponse containing a list of items and headers.
-
-
Method Details