Class DzidziPaginationDTO<T>

java.lang.Object
com.dzidzi.dto.pagination.DzidziPaginationDTO<T>
Type Parameters:
T - the entity
All Implemented Interfaces:
Serializable

public class DzidziPaginationDTO<T> extends Object implements Serializable
DzidziPaginationDTO is used to divide a large list of dataset into smaller pages. Each page contains a subset of the total dataset based on the limit. Using this interface helps users to navigate form one page to the other, that is next pages, previous pages, last page or first page.
See Also:
  • Method Details

    • builder

      public static <T> DzidziPaginationDTO.Builder<T> builder()
    • getPage

      public int getPage()
      The page number.
    • getOffset

      public int getOffset()
      The offset.
    • getLimit

      public int getLimit()
      The limit is used to get a specific amount or subset of a dataset. This is the page.
    • getTotalCount

      public long getTotalCount()
      The total count of the given filter.
    • getTotalPages

      public long getTotalPages()
      This returns the total pages of the dataset expected to return by the query.
    • getResults

      public List<T> getResults()
      The returns the datasets retrieved from the database.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

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

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object