public class PagedResources<T> extends Resources<T>
Modifier and Type | Class and Description |
---|---|
static class |
PagedResources.PageMetadata
Value object for pagination metadata.
|
Modifier and Type | Field and Description |
---|---|
static PagedResources<?> |
NO_PAGE |
Modifier | Constructor and Description |
---|---|
protected |
PagedResources()
Default constructor to allow instantiation by reflection.
|
|
PagedResources(Collection<T> content,
PagedResources.PageMetadata metadata,
Iterable<Link> links)
|
|
PagedResources(Collection<T> content,
PagedResources.PageMetadata metadata,
Link... links)
Creates a new
PagedResources from the given content, PagedResources.PageMetadata and Link s (optional). |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
PagedResources.PageMetadata |
getMetadata()
Returns the pagination metadata.
|
Link |
getNextLink()
Returns the Link pointing to the next page (if set).
|
Link |
getPreviousLink()
Returns the Link pointing to the previous page (if set).
|
int |
hashCode() |
String |
toString() |
static <T extends Resource<S>,S> |
wrap(Iterable<S> content,
PagedResources.PageMetadata metadata)
Factory method to easily create a
PagedResources instance from a set of entities and pagination metadata. |
getContent, iterator, wrap
add, add, add, getId, getLink, getLinks, hasLink, hasLinks, removeLinks
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static PagedResources<?> NO_PAGE
protected PagedResources()
public PagedResources(Collection<T> content, PagedResources.PageMetadata metadata, Link... links)
PagedResources
from the given content, PagedResources.PageMetadata
and Link
s (optional).content
- must not be null.metadata
- links
- public PagedResources(Collection<T> content, PagedResources.PageMetadata metadata, Iterable<Link> links)
content
- must not be null.metadata
- links
- public PagedResources.PageMetadata getMetadata()
public static <T extends Resource<S>,S> PagedResources<T> wrap(Iterable<S> content, PagedResources.PageMetadata metadata)
PagedResources
instance from a set of entities and pagination metadata.content
- must not be null.metadata
- public Link getNextLink()
#addPaginationLinks(Link)
public Link getPreviousLink()
#addPaginationLinks(Link)
Copyright © 2012-2015–2015 Pivotal, Inc.. All rights reserved.