Class PageWrapper<T>
- java.lang.Object
-
- de.digitalcollections.cudami.admin.paging.PageWrapper<T>
-
- Type Parameters:
T- is the paginated type.
public class PageWrapper<T> extends Object
"Spring Data Page interface has many nice functions to get current page number, get total pages, etc. But it’s still lack of ways to let me only display partial page range of total pagination. So I created an adapter class to wrap Spring Data Page interface with additional features."- Author:
- ralf
- See Also:
- Java Code Geeks article
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classPageWrapper.PageItem
-
Field Summary
Fields Modifier and Type Field Description static intMAX_PAGE_ITEM_DISPLAY
-
Constructor Summary
Constructors Constructor Description PageWrapper(org.springframework.data.domain.Page<T> page, String url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<T>getContent()List<PageWrapper.PageItem>getItems()intgetNumber()org.springframework.data.domain.Page<T>getPage()intgetSize()longgetTotalItems()intgetTotalPages()StringgetUrl()booleanisFirstPage()booleanisHasNextPage()booleanisHasPreviousPage()booleanisLastPage()voidsetUrl(String url)
-
-
-
Field Detail
-
MAX_PAGE_ITEM_DISPLAY
public static final int MAX_PAGE_ITEM_DISPLAY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getItems
public List<PageWrapper.PageItem> getItems()
-
getNumber
public int getNumber()
-
getPage
public org.springframework.data.domain.Page<T> getPage()
-
getSize
public int getSize()
-
getTotalItems
public long getTotalItems()
-
getTotalPages
public int getTotalPages()
-
getUrl
public String getUrl()
-
setUrl
public void setUrl(String url)
-
isFirstPage
public boolean isFirstPage()
-
isHasNextPage
public boolean isHasNextPage()
-
isHasPreviousPage
public boolean isHasPreviousPage()
-
isLastPage
public boolean isLastPage()
-
-