Class PagedResources<T>

  • Type Parameters:
    T - The Class of the paginatied content

    public class PagedResources<T>
    extends org.springframework.hateoas.RepresentationModel<PagedResources<T>>
    Base Class for CollectionModel with pagination.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected PagedResources()
      Default constructor to allow instantiation by reflection.
        PagedResources​(Collection<T> content, org.springframework.hateoas.PagedModel.PageMetadata metadata, Iterable<org.springframework.hateoas.Link> links)
      Creates a new PagedResources from the given content PagedModel.PageMetadata and Links.
        PagedResources​(Collection<T> content, org.springframework.hateoas.PagedModel.PageMetadata metadata, org.springframework.hateoas.Link... links)
      Creates a new PagedResources from the given content, PagedModel.PageMetadata and Links (optional).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Collection<T> getContent()
      Returns the content.
      org.springframework.hateoas.PagedModel.PageMetadata getMetadata()
      Returns the pagination metadata.
      • Methods inherited from class org.springframework.hateoas.RepresentationModel

        add, add, add, addAllIf, addIf, equals, getLink, getLink, getLinks, getLinks, getLinks, getRequiredLink, getRequiredLink, hashCode, hasLink, hasLink, hasLinks, of, of, removeLinks, toString
    • Constructor Detail

      • PagedResources

        protected PagedResources()
        Default constructor to allow instantiation by reflection.
      • PagedResources

        public PagedResources​(Collection<T> content,
                              org.springframework.hateoas.PagedModel.PageMetadata metadata,
                              org.springframework.hateoas.Link... links)
        Creates a new PagedResources from the given content, PagedModel.PageMetadata and Links (optional).
        Parameters:
        content - must not be null.
        metadata - the metadata
        links - the links
      • PagedResources

        public PagedResources​(Collection<T> content,
                              org.springframework.hateoas.PagedModel.PageMetadata metadata,
                              Iterable<org.springframework.hateoas.Link> links)
        Creates a new PagedResources from the given content PagedModel.PageMetadata and Links.
        Parameters:
        content - must not be null.
        metadata - the metadata
        links - the links
    • Method Detail

      • getMetadata

        public org.springframework.hateoas.PagedModel.PageMetadata getMetadata()
        Returns the pagination metadata.
        Returns:
        the metadata
      • getContent

        public Collection<T> getContent()
        Returns the content.
        Returns:
        the content