Java Code Examples for com.github.pagehelper.PageInfo#setNavigatePages()

The following examples show how to use com.github.pagehelper.PageInfo#setNavigatePages() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PageInfoHelper.java    From uexam with GNU Affero General Public License v3.0 6 votes vote down vote up
public static <T, J> PageInfo<J> copyMap(PageInfo<T> source, Function<? super T, ? extends J> mapper) {
    PageInfo<J> newPage = new PageInfo<>();
    newPage.setPageNum(source.getPageNum());
    newPage.setPageSize(source.getPageSize());
    newPage.setSize(source.getSize());
    newPage.setStartRow(source.getStartRow());
    newPage.setEndRow(source.getEndRow());
    newPage.setTotal(source.getTotal());
    newPage.setPages(source.getPages());
    newPage.setList(source.getList().stream().map(mapper).collect(Collectors.toList()));
    newPage.setPrePage(source.getPrePage());
    newPage.setNextPage(source.getNextPage());
    newPage.setIsFirstPage(source.isIsFirstPage());
    newPage.setIsLastPage(source.isIsLastPage());
    newPage.setHasPreviousPage(source.isHasPreviousPage());
    newPage.setHasNextPage(source.isHasNextPage());
    newPage.setNavigatePages(source.getNavigatePages());
    newPage.setNavigatepageNums(source.getNavigatepageNums());
    newPage.setNavigateFirstPage(source.getNavigateFirstPage());
    newPage.setNavigateLastPage(source.getNavigateLastPage());
    return newPage;
}
 
Example 2
Source File: PageUtil.java    From spring-microservice-exam with MIT License 6 votes vote down vote up
/**
 * 复制属性
 *
 * @param source source
 * @param target target
 * @author tangyi
 * @date 2019/07/03 22:26:18
 */
public static void copyProperties(PageInfo<?> source, PageInfo<?> target) {
    target.setPageNum(source.getPageNum());
    target.setPageSize(source.getPageSize());
    target.setSize(source.getSize());
    target.setStartRow(source.getStartRow());
    target.setEndRow(source.getEndRow());
    target.setPages(source.getPages());
    target.setPrePage(source.getPrePage());
    target.setNextPage(source.getNextPage());
    target.setIsFirstPage(source.isIsFirstPage());
    target.setIsLastPage(source.isIsLastPage());
    target.setHasPreviousPage(source.isHasPreviousPage());
    target.setHasNextPage(source.isHasNextPage());
    target.setNavigatePages(source.getNavigatePages());
    target.setNavigatepageNums(source.getNavigatepageNums());
    target.setNavigateFirstPage(source.getNavigateFirstPage());
    target.setNavigateLastPage(source.getNavigateLastPage());
    target.setTotal(source.getTotal());
}
 
Example 3
Source File: PageInfoHelper.java    From uexam-mysql with GNU Affero General Public License v3.0 6 votes vote down vote up
public static <T, J> PageInfo<J> copyMap(PageInfo<T> source, Function<? super T, ? extends J> mapper) {
    PageInfo<J> newPage = new PageInfo<>();
    newPage.setPageNum(source.getPageNum());
    newPage.setPageSize(source.getPageSize());
    newPage.setSize(source.getSize());
    newPage.setStartRow(source.getStartRow());
    newPage.setEndRow(source.getEndRow());
    newPage.setTotal(source.getTotal());
    newPage.setPages(source.getPages());
    newPage.setList(source.getList().stream().map(mapper).collect(Collectors.toList()));
    newPage.setPrePage(source.getPrePage());
    newPage.setNextPage(source.getNextPage());
    newPage.setIsFirstPage(source.isIsFirstPage());
    newPage.setIsLastPage(source.isIsLastPage());
    newPage.setHasPreviousPage(source.isHasPreviousPage());
    newPage.setHasNextPage(source.isHasNextPage());
    newPage.setNavigatePages(source.getNavigatePages());
    newPage.setNavigatepageNums(source.getNavigatepageNums());
    newPage.setNavigateFirstPage(source.getNavigateFirstPage());
    newPage.setNavigateLastPage(source.getNavigateLastPage());
    return newPage;
}
 
Example 4
Source File: PageInfoHelper.java    From dynamic-data-source-demo with Apache License 2.0 6 votes vote down vote up
public static <T, R> PageInfo<R> mapPage(PageInfo<T> page, Function<List<T>, List<R>> function) {
    PageInfo<R> resultPage = new PageInfo<>();
    resultPage.setList(function.apply(page.getList()));
    resultPage.setSize(page.getSize());
    resultPage.setPageNum(page.getPageNum());
    resultPage.setPageSize(page.getPageSize());
    resultPage.setStartRow(page.getStartRow());
    resultPage.setEndRow(page.getEndRow());
    resultPage.setTotal(page.getTotal());
    resultPage.setHasPreviousPage(page.isHasPreviousPage());
    resultPage.setHasNextPage(page.isHasNextPage());
    resultPage.setIsFirstPage(page.isIsFirstPage());
    resultPage.setIsLastPage(page.isIsLastPage());
    resultPage.setPages(page.getPages());
    resultPage.setPrePage(page.getPrePage());
    resultPage.setNextPage(page.getNextPage());
    resultPage.setNavigatePages(page.getNavigatePages());
    resultPage.setNavigatepageNums(page.getNavigatepageNums());
    resultPage.setNavigateFirstPage(page.getNavigateFirstPage());
    resultPage.setNavigateLastPage(page.getNavigateLastPage());
    return resultPage;
}