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
Constructors -
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.intReturns the number of elements on the page.intReturns the number of the current page.longReturns the total amount of elements.intReturns the number of total pages.booleanReturns if there is a content exists.booleanhasNext()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, waitMethods 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:PageReturns the number of the current page. Is always non-negative.- Specified by:
getPageNumberin interfacePage<Entity>- Returns:
- the number of the current page.
-
getItemsNumber
public int getItemsNumber()Description copied from interface:PageReturns the number of elements on the page.- Specified by:
getItemsNumberin interfacePage<Entity>- Returns:
- the number of elements on the page.
-
getTotalPages
public int getTotalPages()Description copied from interface:PageReturns the number of total pages.- Specified by:
getTotalPagesin interfacePage<Entity>- Returns:
- the number of total pages
-
getTotalItems
public long getTotalItems()Description copied from interface:PageReturns the total amount of elements.- Specified by:
getTotalItemsin interfacePage<Entity>- Returns:
- the total amount of elements
-
hasNext
public boolean hasNext()Description copied from interface:PageReturns if there is a next page exists. -
iterator
-
getContent
Description copied from interface:PageReturn container content.- Specified by:
getContentin interfacePage<Entity>- Returns:
- container content
-
hasContent
public boolean hasContent()Description copied from interface:PageReturns if there is a content exists.- Specified by:
hasContentin interfacePage<Entity>- Returns:
- true if there is a content exists, otherwise false
-
toString
-