All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinitenature.commons.pagination.Page Maven / Gradle / Ivy

There is a newer version: 0.0.7
Show newest version
package org.infinitenature.commons.pagination;

import java.util.Optional;

public interface Page extends Slice
{
   /**
    * Returns the number of total pages.
    * 
    * @return the number of total pages
    */
   int getTotalPages();

   /**
    * Returns the total amount of elements.
    * 
    * @return the total amount of elements
    */
   long getTotalElements();

   /**
    * Returns the number of the current {@link Page}. Is always non-negative.
    * 
    * @return the number of the current {@link Page}.
    */
   int getNumber();

   /**
    * Returns whether the current {@link Page} is the first one.
    * 
    * @return
    */
   boolean isFirst();

   /**
    * Returns whether the current {@link Page} is the last one.
    * 
    * @return
    */
   boolean isLast();

   /**
    * Returns if there is a next {@link Page}.
    * 
    * @return if there is a next {@link Page}.
    */
   boolean hasNext();

   /**
    * Returns if there is a previous {@link Page}.
    * 
    * @return if there is a previous {@link Page}.
    */
   boolean hasPrevious();

   Optional nextPageRequest();

   Optional previousPageRequest();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy