Class EmbeddedPageHeader

java.lang.Object
org.dspace.app.rest.model.hateoas.EmbeddedPageHeader
Direct Known Subclasses:
EmbeddedPage

public class EmbeddedPageHeader extends Object
This class inserts pagination information into the endpoints. It constructs the "page" element (number, size, totalPages, totalElements) in the HalResource for the endpoints. It also constructs the "_links" element (next, last, prev, self, first) in the HalResource for the endpoints.
  • Field Details

    • page

      protected org.springframework.data.domain.Page page
    • totalElementsIsKnown

      protected boolean totalElementsIsKnown
    • self

      protected UriComponentsBuilder self
  • Constructor Details

    • EmbeddedPageHeader

      public EmbeddedPageHeader(UriComponentsBuilder self, org.springframework.data.domain.Page page, boolean totalElementsIsKnown)
    • EmbeddedPageHeader

      public EmbeddedPageHeader(String self, org.springframework.data.domain.Page page, boolean totalElementsIsKnown)
    • EmbeddedPageHeader

      public EmbeddedPageHeader(UriComponentsBuilder self, org.springframework.data.domain.Page page)
  • Method Details

    • getPageInfo

      public Map<String,Long> getPageInfo()
      Build the "page" element with all valid pagination information (number, size, totalPages, totalElements)
      Returns:
      Map that will be used to build the JSON of the "page" element
    • getLinks

      public Map<String,Object> getLinks()
      Build the "_links" element with all valid pagination links (first, next, prev, last)
      Returns:
      Map that will be used to build the JSON of the "_links" element