Interface PageIterable<T>
-
- Type Parameters:
T
- The modelled type of the object in a page.
- All Superinterfaces:
Iterable<Page<T>>
,SdkIterable<Page<T>>
@ThreadSafe public interface PageIterable<T> extends SdkIterable<Page<T>>
Page iterable represents the result from paginated operations such as scan and query.The result can be accessed either through iterable
Page
s or flattened items across all pages viaitems()
Example:
1) Iterating through pages
PageIterable<MyItem> results = table.scan(); results.stream().forEach(p -> p.items().forEach(item -> System.out.println(item)))
PageIterable<MyItem> results = table.scan(); results.items().stream().forEach(item -> System.out.println(item));
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static <T> PageIterable<T>
create(SdkIterable<Page<T>> pageIterable)
default SdkIterable<T>
items()
Returns an iterable to iterate through the paginatedPage.items()
across all response pages.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface software.amazon.awssdk.core.pagination.sync.SdkIterable
stream
-
-
-
-
Method Detail
-
create
static <T> PageIterable<T> create(SdkIterable<Page<T>> pageIterable)
-
items
default SdkIterable<T> items()
Returns an iterable to iterate through the paginatedPage.items()
across all response pages.This method is useful if you are interested in iterating over the items in the response pages instead of the top level pages.
-
-