Class HalDataPage

All Implemented Interfaces:
Serializable, Cloneable, Iterable<HalData>, Collection<HalData>, List<HalData>, RandomAccess

public class HalDataPage extends ArrayList<HalData> implements List<HalData>
In case the a paginated result set is expected when querying the HalClient, then a HalDataPage will be returned containing the the HalData instances correlating to the requested page as well as additional information about the number of total pages available. Paginated result sets may be expected when calling methods such as HalClient.readPage(String, int, int) or HalClient.readAll(String, org.refcodes.web.FormFields) (or similar) with HTTP-Query-Fields querying a paginated result.
See Also:
  • Field Details

    • PAGE_NUMBER

      public static final String PAGE_NUMBER
      The path to the page's number value (e.g. in an HttpBodyMap).
      See Also:
    • PAGE_SIZE

      public static final String PAGE_SIZE
      The path to the page's size value (e.g. in an HttpBodyMap).
      See Also:
    • PAGE_COUNT

      public static final String PAGE_COUNT
      The path to the total page count value (e.g. in an HttpBodyMap).
      See Also:
  • Constructor Details

    • HalDataPage

      protected HalDataPage()
      Default constructor for usage by sub-classes.
    • HalDataPage

      public HalDataPage(int aPageNumber, int aPageSize, int aPageCount)
      Constructs the HalDataPage instances with the given pagination metrics.
      Parameters:
      aPageNumber - The page's number as of pagination.
      aPageSize - The page's size as of pagination.
      aPageCount - The total page count of the overall result set.
  • Method Details

    • getPageNumber

      public int getPageNumber()
      Returns the number of the page which this HalDataPage instances represents.
      Returns:
      The HalDataPage result set's page number as of pagination.
    • getPageSize

      public int getPageSize()
      Returns the maximum size of the page being requested for the HalDataPage result set. Returns -1 in case no page size has been specified.
      Returns:
      The HalDataPage result set's page size as of pagination.
    • getPageCount

      public int getPageCount()
      Returns the total number of the pages which are available for retrieval.
      Returns:
      The total number of the pages representing the overall result set..