public class PageIterator<T extends com.abiquo.model.transport.WrapperDto<? extends com.abiquo.model.transport.SingleResourceTransportDto>>
extends com.google.common.collect.AbstractIterator<T>
Iterator that is capable of advancing between the pages of a paginated collection.
To create this iterator use the #flatten(ApiClient, WrapperDto) method.
| Modifier and Type | Class and Description |
|---|---|
static class |
PageIterator.AdvancingIterable<T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends com.abiquo.model.transport.WrapperDto<T>>
An
Iterable that is capable of advancing between pages. |
| Modifier and Type | Method and Description |
|---|---|
protected T |
computeNext() |
static <T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends com.abiquo.model.transport.WrapperDto<T>> |
flatten(RestClient api,
W dto)
Creates an iterator capable of advancing over the elements of a paginated collection, and
lazily fetch new pages as they are needed.
|
protected T computeNext()
computeNext in class com.google.common.collect.AbstractIterator<T extends com.abiquo.model.transport.WrapperDto<? extends com.abiquo.model.transport.SingleResourceTransportDto>>public static <T extends com.abiquo.model.transport.SingleResourceTransportDto,W extends com.abiquo.model.transport.WrapperDto<T>> Iterable<T> flatten(RestClient api, W dto)
api - The rest client used to fetch new pages when needed.dto - The collection to iterate.Copyright © 2008–2015 Abiquo Holdings S.L.. All rights reserved.