Class DefaultPage<T>

java.lang.Object
org.apache.dubbo.common.utils.DefaultPage<T>
All Implemented Interfaces:
Serializable, Page<T>

public class DefaultPage<T> extends Object implements Page<T>, Serializable
The default implementation of Page
Since:
2.7.5
See Also:
  • Constructor Details

    • DefaultPage

      public DefaultPage(int requestOffset, int pageSize, List<T> data, int totalSize)
  • Method Details

    • getOffset

      public int getOffset()
      Description copied from interface: Page
      Gets the offset of request
      Specified by:
      getOffset in interface Page<T>
      Returns:
      positive integer
    • getPageSize

      public int getPageSize()
      Description copied from interface: Page
      Gets the size of request for pagination query
      Specified by:
      getPageSize in interface Page<T>
      Returns:
      positive integer
    • getTotalSize

      public int getTotalSize()
      Description copied from interface: Page
      Gets the total amount of elements.
      Specified by:
      getTotalSize in interface Page<T>
      Returns:
      the total amount of elements
    • getTotalPages

      public int getTotalPages()
      Description copied from interface: Page
      Get the number of total pages.
      Specified by:
      getTotalPages in interface Page<T>
      Returns:
      the number of total pages.
    • getData

      public List<T> getData()
      Description copied from interface: Page
      The data of current page
      Specified by:
      getData in interface Page<T>
      Returns:
      non-null List
    • hasNext

      public boolean hasNext()
      Description copied from interface: Page
      It indicates has next page or not
      Specified by:
      hasNext in interface Page<T>
      Returns:
      if has , return true, or false