Class PagingLink.PagingLinkBuilder

  • Enclosing class:
    PagingLink

    public static class PagingLink.PagingLinkBuilder
    extends Object
    Builds Link headers to handle LDP pagination.
    • Method Detail

      • first

        public PagingLink.PagingLinkBuilder first​(URI first)
        Specifies the URI of the first page. It is the one that a LDP Paging server redirects to (303 response) in response to a retrieval request for the paged resource's URI.
        Parameters:
        first - the first page URI
        Returns:
        this builder
      • next

        public PagingLink.PagingLinkBuilder next​(URI next)
        Specifies the URI of the next page. It tells the client that at least one more in-sequence page resource exists, and how to retrieve it.
        Parameters:
        next - the next page URI
        Returns:
        this builder
      • last

        public PagingLink.PagingLinkBuilder last​(URI last)
        Specifies the URI of the last page.
        Parameters:
        last - the last page URI
        Returns:
        this builder
      • prev

        public PagingLink.PagingLinkBuilder prev​(URI prev)
        Specifies the URI of the previous page.
        Parameters:
        prev - the previous page URI
        Returns:
        this builder
      • type

        public PagingLink.PagingLinkBuilder type​(URI type)
        Specifies the type of LDP response. http://www.w3.org/ns/ldp#Page tells the client that the response is an in-sequence page resource, and therefore it needs to examine the other response headers to see if more data existed in the canonical paged resource when the response was generated by the server.
        Parameters:
        type - the type of LDP response
        Returns:
        this builder
      • canonical

        public PagingLink.PagingLinkBuilder canonical​(URI canonical,
                                                      Optional<String> etag)
        Specifies the URI of the canonical resource. It tells the client, for a given page, which paginated resource is it a page of. The etag parameter gives the client a way to know, during its page traversal, whether or not the canonical paged resource has changed; not all clients will use this information, but it is there for those that can make use of it.
        Parameters:
        canonical - the canonical resource URI
        etag - the canonical resource etag
        Returns:
        this builder
      • build

        public PagingLink build()
        Builds a {code PagingLink} with the required features.
        Returns:
        the PagingLink