Class Page<T>


  • public class Page<T>
    extends Object
    • Method Detail

      • getRecords

        public List<T> getRecords()
      • getFirstPageUrl

        public String getFirstPageUrl​(String domain)
        Generate first page url for a list result.
        Parameters:
        domain - domain to use
        Returns:
        the first page url
      • getNextPageUrl

        public String getNextPageUrl​(String domain)
        Generate next page url for a list result.
        Parameters:
        domain - domain to use
        Returns:
        the next page url
      • getPreviousPageUrl

        public String getPreviousPageUrl​(String domain)
        Generate previous page url for a list result.
        Parameters:
        domain - domain to use
        Returns:
        the previous page url
      • getPageSize

        public int getPageSize()
      • getUrl

        public String getUrl​(String domain)
        Generate page url for a list result.
        Parameters:
        domain - domain to use
        Returns:
        the page url
      • hasNextPage

        public boolean hasNextPage()
      • fromJson

        public static <T> Page<T> fromJson​(String recordKey,
                                           String json,
                                           Class<T> recordType,
                                           com.fasterxml.jackson.databind.ObjectMapper mapper)
        Create a new page of data from a json blob.
        Type Parameters:
        T - record class type
        Parameters:
        recordKey - key which holds the records
        json - json blob
        recordType - resource type
        mapper - json parser
        Returns:
        a page of records of type T