Package org.vx68k.bitbucket.api.client
Class PaginatedList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- org.vx68k.bitbucket.api.client.PaginatedList<E>
-
- Type Parameters:
E
- type of the elements
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,List<E>
public class PaginatedList<E> extends AbstractList<E>
Paginated list on Bitbucket Cloud.- Since:
- 5.0
- Author:
- Kaz Nishimura
- See Also:
- Pagination
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description PaginatedList(URI firstPage, BitbucketClient bitbucketClient, Function<JsonObject,? extends E> creator)
Initializes this object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
fetchNext()
Fetches the next page.E
get(int index)
int
size()
-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Constructor Detail
-
PaginatedList
public PaginatedList(URI firstPage, BitbucketClient bitbucketClient, Function<JsonObject,? extends E> creator)
Initializes this object.- Parameters:
firstPage
- the URI of the first pagebitbucketClient
- a Bitbucket API clientcreator
- a function to create each element
-
-
Method Detail
-
fetchNext
protected final void fetchNext()
Fetches the next page.
-
get
public final E get(int index)
-
size
public final int size()
- Specified by:
size
in interfaceCollection<E>
- Specified by:
size
in interfaceList<E>
- Specified by:
size
in classAbstractCollection<E>
-
-