Package com.emc.documentum.rest.paging
Class Page<T>
java.lang.Object
com.emc.documentum.rest.paging.Page<T>
- Type Parameters:
T
- the object class in the page
A page class provides all the information for the paginated items.
-
Constructor Summary
ConstructorDescriptionConstructor to build a page of items if your items are already paginated, DO NOT use the Paginator class and use this constructor directlyConstructor to build a page of items if your items are already paginated, DO NOT use the Paginator class and use this constructor directly -
Method Summary
Modifier and TypeMethodDescriptionboolean
hasItem()
Check whether this page is empty or not.boolean
If the page is the last page or the page does not contain the items requested in this page (which means there is no remaining items available), the page has next pageboolean
Check whether this page has a previous one.boolean
Check whether this page is the first one.boolean
Determine if current page is the last pageboolean
Check whether this page contains the complete item collection.boolean
Check whether the total count is known by this page.items()
Return the items in the page.int
Return the item size per page; it may be different with the actual item count in this page.int
page()
Return the page countvoid
setTotalForEach
(Map<String, Integer> totalForEach) total()
Return the total account of the queried objects on the server side (not for this page); it's specified in the constructor.
-
Constructor Details
-
Page
Constructor to build a page of items if your items are already paginated, DO NOT use the Paginator class and use this constructor directly- Parameters:
itemList
- all the items in current pagetotal
- Set total to null if it is unknownpage
- the page number for current pageitemsPerPage
- the number of items current page
-
Page
Constructor to build a page of items if your items are already paginated, DO NOT use the Paginator class and use this constructor directly- Parameters:
itemList
- the itemstotal
- Set total to null if it is unknownpage
- the page number for current pageitemsPerPage
- the number of items current pagehasMore
- whether there are more items
-
-
Method Details
-
setTotalForEach
-
getTotalForEach
-
items
Return the items in the page.- Returns:
- the items in the page
-
hasItem
public boolean hasItem()Check whether this page is empty or not.- Returns:
true
if the page has items;false
otherwise
-
total
Return the total account of the queried objects on the server side (not for this page); it's specified in the constructor.- Returns:
- total number of queried objects
-
isOnePageOnly
public boolean isOnePageOnly()Check whether this page contains the complete item collection.- Returns:
true
if the page has contained the complete item colleciton on the server side;false
otherwise.
-
isTotalKnown
public boolean isTotalKnown()Check whether the total count is known by this page. The total count is known only when it is specified in the constructor.- Returns:
true
if the total count is known;false
otherwise.
-
page
public int page()Return the page count- Returns:
- the page count
-
itemsPerPage
public int itemsPerPage()Return the item size per page; it may be different with the actual item count in this page.- Returns:
- the item size per page
-
hasPreviousPage
public boolean hasPreviousPage()Check whether this page has a previous one.- Returns:
true
if it has a previous page;false
otherwise.
-
hasNextPage
public boolean hasNextPage()If the page is the last page or the page does not contain the items requested in this page (which means there is no remaining items available), the page has next page- Returns:
true
if this page contains a next page;false
otherwise
-
isFirstPage
public boolean isFirstPage()Check whether this page is the first one.- Returns:
true
if it is the first page;false
otherwise.
-
isLastPage
public boolean isLastPage()Determine if current page is the last page- Returns:
- true/false if the current page is last page or not, return false if it is unknown
-