Class PaginationParameters


  • public class PaginationParameters
    extends java.lang.Object
    Specifies page parameters for retrieving items stored in the platform. It can be used for reading items in batches (pages), where getPageSize() specifies items per page and getPageStart() specifies how many items should be skipped and not included in the page result.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static PaginationParameters create​(int start, int size)
      Creates new instance of PaginationParameters with specified characteristics.
      boolean equals​(java.lang.Object o)  
      int getPageSize()
      Retrieves number of items to return in the search result.
      int getPageStart()
      Retrieves number of items to be skipped in the result set.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • create

        public static PaginationParameters create​(int start,
                                                  int size)
        Creates new instance of PaginationParameters with specified characteristics.
        Parameters:
        start - specifies position of the first item to be returned in the search result within the search result set. For example, if there are 200 items in the persistent storage and this parameter is equal to 100, then first 100 items will be skipped and the result will contain items beginning from the 100th item.

        Any negative or zero value means the result should not skip items and that it will contain items beginning from the very first item in the result set.

        size - number of items to include in the result set. Any negative number is treated as 0.

        This parameter allows to limit number of items returned, so that the application would not attempt to load too many items matching the search criteria into the memory and result in the OutOfMemoryError.

        Returns:
        a value object with the specified parameters.
      • getPageStart

        public int getPageStart()
        Retrieves number of items to be skipped in the result set.
        Returns:
        requested items will be read from the persistent storage, then, if offset is greater than 0, the offset number of items at the beginning of the result set will be removed.
        See Also:
        create(int, int)
      • getPageSize

        public int getPageSize()
        Retrieves number of items to return in the search result.
        Returns:
        number of items to be retrieved. The search result may contain fewer number of items or maybe even not items, but it should not contain more items then the page size specified.
        See Also:
        create(int, int)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object