Class PageImpl<T>

java.lang.Object
com.power4j.fist.data.domain.PageImpl<T>
Type Parameters:
T - 实体类型
All Implemented Interfaces:
Paged<T>

public class PageImpl<T> extends Object implements Paged<T>
Since:
1.0
Author:
CJ (power4j@outlook.com)
  • Field Details

  • Constructor Details

    • PageImpl

      public PageImpl(@Nullable List<T> content, Pageable pageable, long total)
  • Method Details

    • getPageNumber

      public int getPageNumber()
      Description copied from interface: Paged
      返回当前页码
      Specified by:
      getPageNumber in interface Paged<T>
      Returns:
      返回当前页码
    • getPageSize

      public int getPageSize()
      Description copied from interface: Paged
      返回页大小
      Specified by:
      getPageSize in interface Paged<T>
      Returns:
      返回页大小
    • getNumberOfElements

      public int getNumberOfElements()
      Description copied from interface: Paged
      返回当前数据条数
      Specified by:
      getNumberOfElements in interface Paged<T>
      Returns:
      返回当前数据条数
    • getTotalPages

      public int getTotalPages()
      Description copied from interface: Paged
      总页数
      Specified by:
      getTotalPages in interface Paged<T>
      Returns:
      返回总页数
    • getTotalElements

      public long getTotalElements()
      Description copied from interface: Paged
      总记录数
      Specified by:
      getTotalElements in interface Paged<T>
      Returns:
      返回总记录数
    • getContent

      public List<T> getContent()
      Description copied from interface: Paged
      获取数据
      Specified by:
      getContent in interface Paged<T>
      Returns:
      返回数据
    • hasContent

      public boolean hasContent()
      Description copied from interface: Paged
      是否包含数据
      Specified by:
      hasContent in interface Paged<T>
      Returns:
      boolean
    • getSort

      public Sort getSort()
      Description copied from interface: Paged
      返回请求使用的排序参数
      Specified by:
      getSort in interface Paged<T>
      Returns:
      Sort
    • isFirst

      public boolean isFirst()
      Description copied from interface: Paged
      是否为第一页
      Specified by:
      isFirst in interface Paged<T>
      Returns:
      boolean
    • isLast

      public boolean isLast()
      Description copied from interface: Paged
      是否为最后一页
      Specified by:
      isLast in interface Paged<T>
      Returns:
      boolean
    • hasNext

      public boolean hasNext()
      Description copied from interface: Paged
      是否有下一页
      Specified by:
      hasNext in interface Paged<T>
      Returns:
      表示可以向后翻页
    • hasPrevious

      public boolean hasPrevious()
      Description copied from interface: Paged
      是否有前一页
      Specified by:
      hasPrevious in interface Paged<T>
      Returns:
      true 表示可以向前翻页
    • nextPageable

      public Pageable nextPageable()
      Description copied from interface: Paged
      返回下一页的分页请求,使用方应该先检查是否存在下一页
      Specified by:
      nextPageable in interface Paged<T>
      Returns:
      Pageable
      See Also:
    • previousPageable

      public Pageable previousPageable()
      Description copied from interface: Paged
      返回前一页的分页请求,使用方应该先检查是否存在前一页
      Specified by:
      previousPageable in interface Paged<T>
      Returns:
      Pageable
      See Also:
    • map

      public <U> Paged<U> map(Function<? super T,? extends U> converter)
      Description copied from interface: Paged
      转换方法
      Specified by:
      map in interface Paged<T>
      Parameters:
      converter - 转换函数
      Returns:
      Paged
    • getConvertedContent

      protected <U> List<U> getConvertedContent(Function<? super T,? extends U> converter)