Class PageImpl<Entity>
java.lang.Object
com.labs64.netlicensing.domain.vo.PageImpl<Entity>
- Type Parameters:
Entity
- the type of which the page consists.
- All Implemented Interfaces:
Page<Entity>
,Serializable
,Iterable<Entity>
Basic
Page
implementation.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E> PageImpl<E>
createInstance
(List<E> content, String pageNumber, String itemsNumber, String totalPages, String totalItems, String hasNext) Safe create instance ofPage
.Return container content.int
Returns the number of elements on the page.int
Returns the number of the current page.long
Returns the total amount of elements.int
Returns the number of total pages.boolean
Returns if there is a content exists.boolean
hasNext()
Returns if there is a next page exists.iterator()
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PageImpl
public PageImpl(List<Entity> content, int pageNumber, int itemsNumber, int totalPages, long totalItems, boolean hasNext) Constructor ofPageImpl
.- Parameters:
content
- the content of this page, must not be null.pageNumber
- the number of the current pageitemsNumber
- the number of elements on the pagetotalPages
- the number of total pagestotalItems
- the total amount of elementshasNext
- is there a next page exists
-
-
Method Details
-
createInstance
public static <E> PageImpl<E> createInstance(List<E> content, String pageNumber, String itemsNumber, String totalPages, String totalItems, String hasNext) Safe create instance ofPage
.- Type Parameters:
E
- type of page entity- Parameters:
content
- the content of this page, must not be null.pageNumber
- the number of the current pageitemsNumber
- the number of elements on the pagetotalPages
- the number of total pagestotalItems
- the total amount of elementshasNext
- is there a next page exists
-
getPageNumber
public int getPageNumber()Description copied from interface:Page
Returns the number of the current page. Is always non-negative.- Specified by:
getPageNumber
in interfacePage<Entity>
- Returns:
- the number of the current page.
-
getItemsNumber
public int getItemsNumber()Description copied from interface:Page
Returns the number of elements on the page.- Specified by:
getItemsNumber
in interfacePage<Entity>
- Returns:
- the number of elements on the page.
-
getTotalPages
public int getTotalPages()Description copied from interface:Page
Returns the number of total pages.- Specified by:
getTotalPages
in interfacePage<Entity>
- Returns:
- the number of total pages
-
getTotalItems
public long getTotalItems()Description copied from interface:Page
Returns the total amount of elements.- Specified by:
getTotalItems
in interfacePage<Entity>
- Returns:
- the total amount of elements
-
hasNext
public boolean hasNext()Description copied from interface:Page
Returns if there is a next page exists. -
iterator
-
getContent
Description copied from interface:Page
Return container content.- Specified by:
getContent
in interfacePage<Entity>
- Returns:
- container content
-
hasContent
public boolean hasContent()Description copied from interface:Page
Returns if there is a content exists.- Specified by:
hasContent
in interfacePage<Entity>
- Returns:
- true if there is a content exists, otherwise false
-
toString
-