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
ConstructorsConstructorDescriptionConstructor 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 TypeMethodDescriptionbooleanhasItem()Check whether this page is empty or not.booleanIf 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 pagebooleanCheck whether this page has a previous one.booleanCheck whether this page is the first one.booleanDetermine if current page is the last pagebooleanCheck whether this page contains the complete item collection.booleanCheck whether the total count is known by this page.items()Return the items in the page.intReturn the item size per page; it may be different with the actual item count in this page.intpage()Return the page countvoidsetTotalForEach(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:
trueif the page has items;falseotherwise
-
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:
trueif the page has contained the complete item colleciton on the server side;falseotherwise.
-
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:
trueif the total count is known;falseotherwise.
-
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:
trueif it has a previous page;falseotherwise.
-
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:
trueif this page contains a next page;falseotherwise
-
isFirstPage
public boolean isFirstPage()Check whether this page is the first one.- Returns:
trueif it is the first page;falseotherwise.
-
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
-