Package com.okta.sdk.resource.client
Class PagedIterable<T>
java.lang.Object
com.okta.sdk.resource.client.PagedIterable<T>
- Type Parameters:
T- The type of item in the collection (e.g., User)
- All Implemented Interfaces:
Iterable<T>
A new lazy, paginated iterable.
This class is a "recipe" for fetching paginated data. It does no
work until the iterator() method is called (e.g., by a for-each loop).
Each call to iterator() creates a new, independent PagedIterator instance,
ensuring thread-safety and isolation of pagination state.
-
Constructor Summary
ConstructorsConstructorDescriptionPagedIterable(Function<String, ApiResponse<List<T>>> pageFetcher) Constructs a new PagedIterable 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.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PagedIterable
Constructs a new PagedIterable 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