Class HalDataPage
- All Implemented Interfaces:
Serializable, Cloneable, Iterable<HalData>, Collection<HalData>, List<HalData>, RandomAccess, SequencedCollection<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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe path to the total page count value (e.g. in anHttpBodyTable).static final StringThe path to the page's number value (e.g. in anHttpBodyTable).static final StringThe path to the page's size value (e.g. in anHttpBodyTable).Fields inherited from class AbstractList
modCount -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor for usage by sub-classes.HalDataPage(int aPageNumber, int aPageSize, int aPageCount) Constructs theHalDataPageinstances with the given pagination metrics. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the total number of the pages which are available for retrieval.intReturns the number of the page which thisHalDataPageinstances represents.intReturns the maximum size of the page being requested for theHalDataPageresult set.Methods inherited from class ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class AbstractCollection
containsAll, toStringMethods inherited from interface Collection
parallelStream, stream, toArrayMethods inherited from interface List
containsAll, reversed
-
Field Details
-
PAGE_NUMBER
The path to the page's number value (e.g. in anHttpBodyTable).- See Also:
-
PAGE_SIZE
The path to the page's size value (e.g. in anHttpBodyTable).- See Also:
-
PAGE_COUNT
The path to the total page count value (e.g. in anHttpBodyTable).- See Also:
-
-
Constructor Details
-
HalDataPage
protected HalDataPage()Default constructor for usage by sub-classes. -
HalDataPage
public HalDataPage(int aPageNumber, int aPageSize, int aPageCount) Constructs theHalDataPageinstances 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 thisHalDataPageinstances represents.- Returns:
- The
HalDataPageresult set's page number as of pagination.
-
getPageSize
public int getPageSize()Returns the maximum size of the page being requested for theHalDataPageresult set. Returns -1 in case no page size has been specified.- Returns:
- The
HalDataPageresult 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..
-