org.silverpeas.persistence.repository
Class PaginationCriterion

java.lang.Object
  extended by org.silverpeas.persistence.repository.PaginationCriterion

public class PaginationCriterion
extends Object

A pagination criterion. This criterion is aimed to a query for persisted entities in order to limit the number of return of such entities.

Author:
mmoquillon

Field Summary
static PaginationCriterion NO_PAGINATION
          This instance represents no pagination.
 
Constructor Summary
PaginationCriterion(int page, int count)
          Constructs a new pagination criterion from the specified page number and count of items this page has to gather.
 
Method Summary
 int getItemCount()
          The maximum number of items the page has to contain.
 int getPageNumber()
          The page number.
 boolean isDefined()
          Is this pagination criterion defined.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_PAGINATION

public static final PaginationCriterion NO_PAGINATION
This instance represents no pagination. It is the equivalent of the null value but in a better typed way.

Constructor Detail

PaginationCriterion

public PaginationCriterion(int page,
                           int count)
Constructs a new pagination criterion from the specified page number and count of items this page has to gather.

Parameters:
page - the page number. It identifies in a pagination the page of items.
count - the number of items to return within the page.
Method Detail

getPageNumber

public int getPageNumber()
The page number.

Returns:
a positive integer identifying the page of items to return.

getItemCount

public int getItemCount()
The maximum number of items the page has to contain.

Returns:
the maximum number of items to return.

isDefined

public boolean isDefined()
Is this pagination criterion defined.

Returns:
true if this pagination criterion isn't the NO_PAGINATION instance.


Copyright © 2016 Silverpeas. All Rights Reserved.