Class PageableBase

java.lang.Object
org.gbif.api.model.common.paging.PageableBase
All Implemented Interfaces:
Pageable
Direct Known Subclasses:
DescriptorGroupSearchRequest, DescriptorSearchRequest, PagingRequest, PagingResponse, RequestSearchParams, SearchRequest

public class PageableBase extends Object implements Pageable
Generically is a class that contains attributes used by operations that are aware of pagination. Its properties are final to allow calculations in other setter methods.
  • Method Details

    • getLimit

      public int getLimit()
      Total of rows that are returned.
      Specified by:
      getLimit in interface Pageable
      Returns:
      the limit.
    • setLimit

      public void setLimit(int limit)
      Parameters:
      limit - the non negative limit to set
      Throws:
      IllegalArgumentException - if negative
    • getOffset

      public long getOffset()
      Defines how many items to skip before beginning to return rows.
      Specified by:
      getOffset in interface Pageable
      Returns:
      the offset with 0 being no offset at all.
    • setOffset

      public void setOffset(long offset)
      Parameters:
      offset - the non negative offset to set
      Throws:
      IllegalArgumentException - if negative
    • addOffset

      public void addOffset(long offsetDiff)
      Adds to existing offset, setting offset to zero if it would be negative.
      Parameters:
      offsetDiff - to be added to existing offset.
    • copyPagingValues

      public void copyPagingValues(Pageable pageable)
      Utility method to copy paging values.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object