use of org.springframework.hateoas.core.EmbeddedWrapper in project spring-data-commons by spring-projects.
the class PagedResourcesAssembler method toEmptyResource.
private PagedResources<?> toEmptyResource(Page<?> page, Class<?> type, Optional<Link> link) {
Assert.notNull(page, "Page must must not be null!");
Assert.isTrue(!page.hasContent(), "Page must not have any content!");
Assert.notNull(type, "Type must not be null!");
Assert.notNull(link, "Link must not be null!");
PageMetadata metadata = asPageMetadata(page);
EmbeddedWrapper wrapper = wrappers.emptyCollectionOf(type);
List<EmbeddedWrapper> embedded = Collections.singletonList(wrapper);
return addPaginationLinks(new PagedResources<>(embedded, metadata), page, link);
}
Aggregations