Class CollectionPage<T>
- java.lang.Object
-
- com.github.davidmoten.odata.client.CollectionPage<T>
-
- Type Parameters:
T- item type
- All Implemented Interfaces:
Paged<T,CollectionPage<T>>,Iterable<T>
public final class CollectionPage<T> extends Object implements Paged<T,CollectionPage<T>>
Note this object has been annotated with JsonProperty declarations but the user should not try to unmarshall a CollectionPage from json because it will be missing critical fields to operate correctly.
-
-
Constructor Summary
Constructors Constructor Description CollectionPage(ContextPath contextPath, Class<T> cls, List<T> list, Optional<String> nextLink, List<RequestHeader> requestHeaders, HttpRequestOptions options)CollectionPage(ContextPath contextPath, Class<T> cls, List<T> list, Optional<String> nextLink, Optional<String> deltaLink, UnmappedFields unmappedFields, List<RequestHeader> requestHeaders, HttpRequestOptions options, Consumer<? super CollectionPage<T>> listener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<T>currentPage()Optional<String>deltaLink()Optional<CollectionPage<T>>nextDelta()Returns the next delta (if exists) as given by the last page of the current collection which may have a deltaLink attribute.Optional<String>nextLink()Optional<CollectionPage<T>>nextPage()Stream<ObjectOrDeltaLink<T>>streamWithDeltaLink()Returns a stream of the paged objects (wrapped) followed by a deltaLink.StringtoJsonMinimal()Returns the list of items in odata collection formatted json but with one optionally present@odata.nextLinkentry.UnmappedFieldsunmappedFields()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
CollectionPage
public CollectionPage(ContextPath contextPath, Class<T> cls, List<T> list, Optional<String> nextLink, Optional<String> deltaLink, UnmappedFields unmappedFields, List<RequestHeader> requestHeaders, HttpRequestOptions options, Consumer<? super CollectionPage<T>> listener)
-
CollectionPage
public CollectionPage(ContextPath contextPath, Class<T> cls, List<T> list, Optional<String> nextLink, List<RequestHeader> requestHeaders, HttpRequestOptions options)
-
-
Method Detail
-
currentPage
public List<T> currentPage()
- Specified by:
currentPagein interfacePaged<T,CollectionPage<T>>
-
nextDelta
public Optional<CollectionPage<T>> nextDelta()
Returns the next delta (if exists) as given by the last page of the current collection which may have a deltaLink attribute. If the last page hasn't been retrieved yet then all pages up to the last page will be retrieved first by this command.- Returns:
- the next delta collection if exists
-
toJsonMinimal
public String toJsonMinimal()
Returns the list of items in odata collection formatted json but with one optionally present@odata.nextLinkentry. The list of items is represented by an array with field namevalue.- Returns:
- json for the list plus nextLink
-
nextPage
public Optional<CollectionPage<T>> nextPage()
- Specified by:
nextPagein interfacePaged<T,CollectionPage<T>>
-
streamWithDeltaLink
public Stream<ObjectOrDeltaLink<T>> streamWithDeltaLink()
Returns a stream of the paged objects (wrapped) followed by a deltaLink. If there are no objects then the stream will have a deltaLink object only (the deltaLink value may or may not be present in that object).- Returns:
- a stream of the paged objects (wrapped) followed by a deltaLink.
-
unmappedFields
public UnmappedFields unmappedFields()
-
-