|
Spring Data Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.data.web.PagedResourcesAssembler<T>
public class PagedResourcesAssembler<T>
ResourceAssembler to easily convert Page instances into PagedResources.
| Constructor Summary | |
|---|---|
PagedResourcesAssembler(HateoasPageableHandlerMethodArgumentResolver resolver,
UriComponents baseUri)
Creates a new PagedResourcesAssembler using the given PageableHandlerMethodArgumentResolver and
base URI. |
|
| Method Summary | ||
|---|---|---|
org.springframework.hateoas.PagedResources<org.springframework.hateoas.Resource<T>> |
toResource(Page<T> entity)
|
|
org.springframework.hateoas.PagedResources<org.springframework.hateoas.Resource<T>> |
toResource(Page<T> page,
org.springframework.hateoas.Link selfLink)
Creates a new PagedResources by converting the given Page into a PagedResources.PageMetadata instance and
wrapping the contained elements into Resource instances. |
|
|
toResource(Page<T> page,
org.springframework.hateoas.ResourceAssembler<T,R> assembler)
Creates a new PagedResources by converting the given Page into a PagedResources.PageMetadata instance and
using the given ResourceAssembler to turn elements of the Page into resources. |
|
|
toResource(Page<T> page,
org.springframework.hateoas.ResourceAssembler<T,R> assembler,
org.springframework.hateoas.Link link)
Creates a new PagedResources by converting the given Page into a PagedResources.PageMetadata instance and
using the given ResourceAssembler to turn elements of the Page into resources. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PagedResourcesAssembler(HateoasPageableHandlerMethodArgumentResolver resolver,
UriComponents baseUri)
PagedResourcesAssembler using the given PageableHandlerMethodArgumentResolver and
base URI. If the former is null, a default one will be created. If the latter is null, calls
to toResource(Page) will use the current request's URI to build the relevant previous and next links.
resolver - baseUri - | Method Detail |
|---|
public org.springframework.hateoas.PagedResources<org.springframework.hateoas.Resource<T>> toResource(Page<T> entity)
toResource in interface org.springframework.hateoas.ResourceAssembler<Page<T>,org.springframework.hateoas.PagedResources<org.springframework.hateoas.Resource<T>>>
public org.springframework.hateoas.PagedResources<org.springframework.hateoas.Resource<T>> toResource(Page<T> page,
org.springframework.hateoas.Link selfLink)
PagedResources by converting the given Page into a PagedResources.PageMetadata instance and
wrapping the contained elements into Resource instances. Will add pagination links based on the given the
self link.
page - must not be null.selfLink - must not be null.
public <R extends org.springframework.hateoas.ResourceSupport> org.springframework.hateoas.PagedResources<R> toResource(Page<T> page,
org.springframework.hateoas.ResourceAssembler<T,R> assembler)
PagedResources by converting the given Page into a PagedResources.PageMetadata instance and
using the given ResourceAssembler to turn elements of the Page into resources.
page - must not be null.assembler - must not be null.
public <R extends org.springframework.hateoas.ResourceSupport> org.springframework.hateoas.PagedResources<R> toResource(Page<T> page,
org.springframework.hateoas.ResourceAssembler<T,R> assembler,
org.springframework.hateoas.Link link)
PagedResources by converting the given Page into a PagedResources.PageMetadata instance and
using the given ResourceAssembler to turn elements of the Page into resources. Will add pagination
links based on the given the self link.
page - must not be null.assembler - must not be null.link - must not be null.
|
Spring Data Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||