com.h3c.util

## Class OneBasedPageRequest

- java.lang.Object
- - com.h3c.util.OneBasedPageRequest

- All Implemented Interfaces:
    Serializable

      public class OneBasedPageRequest
      extends Object
      implements Serializable

  Page request containing the specific page index desired, and the number of objects to be returned per page. This page request using a "one based" index into the array of available pages, with the first available page referenced as slot 1 into the array.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OneBasedPageRequest(int pageSize)` Creates a request for the first page.
    `OneBasedPageRequest(int pageIndex, int pageSize)` Creates a page request.
    `OneBasedPageRequest(PageRequest zeroBasedRequest)` Creates a request for One based data based on the supplied page request

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getPageIndex()` Gets the page index.
    `int` | `getPageSize()` Gets the page size (maximum number of data items per page).
    `PageRequest` | `toPageRequest()` Converts this One based page request to a zero based page request

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### OneBasedPageRequest

          public OneBasedPageRequest(int pageSize)

      Creates a request for the first page.
      Parameters:
        `pageSize` - page size (maximum number of data items per page).

    - #### OneBasedPageRequest

          public OneBasedPageRequest(PageRequest zeroBasedRequest)

      Creates a request for One based data based on the supplied page request
      Parameters:
        `zeroBasedRequest` - the zero based page request to be represented as a one based page request

    - #### OneBasedPageRequest

          public OneBasedPageRequest(int pageIndex,
                             int pageSize)
                              throws IllegalArgumentException

      Creates a page request.
      Parameters:
        `pageIndex` - page index.
        `pageSize` - page size (maximum number of data items per page).
      Throws:
        `IllegalArgumentException` - if `pageIndex` is less than one.

  - ### Method Detail

    - #### getPageIndex

          public int getPageIndex()

      Gets the page index.
      Returns:
        the page index.

    - #### getPageSize

          public int getPageSize()

      Gets the page size (maximum number of data items per page).
      Returns:
        the page size.

    - #### toPageRequest

          public PageRequest toPageRequest()

      Converts this One based page request to a zero based page request
      Returns:
        a zero based page request

Copyright © 2014. All Rights Reserved.