org.springframework.data.querydsl

## Class QPageRequest

- java.lang.Object
- - org.springframework.data.domain.AbstractPageRequest
  - - org.springframework.data.querydsl.QPageRequest

All Implemented Interfaces:
  Serializable, Pageable

    public class QPageRequest
    extends AbstractPageRequest

Basic Java Bean implementation of `Pageable` with support for QueryDSL.

Author:
  Thomas Darimont, Oliver Drotbohm
See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`QPageRequest(int page, int size)` Deprecated. since 2.1, use `of(int, int)` instead.
`QPageRequest(int page, int size, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers)` Deprecated. since 2.1, use `of(int, int, OrderSpecifier...)` instead.
`QPageRequest(int page, int size, QSort sort)` Deprecated. since 2.1, use `of(int, int, QSort)` instead.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`Pageable` `first()` Returns the `Pageable` requesting the first page.
`Sort` `getSort()` Returns the sorting parameters.
`Pageable` `next()` Returns the `Pageable` requesting the next `Page`.
`static QPageRequest` `of(int page, int size)` Creates a new `QPageRequest`.
`static QPageRequest` `of(int page, int size, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers)` Creates a new `QPageRequest` with the given `OrderSpecifier`s applied.
`static QPageRequest` `of(int page, int size, QSort sort)` Creates a new `QPageRequest` with sort parameters applied.
`Pageable` `previous()` Returns the `Pageable` requesting the previous `Page`.

### Methods inherited from class org.springframework.data.domain.AbstractPageRequest

`equals, getOffset, getPageNumber, getPageSize, hashCode, hasPrevious, previousOrFirst`

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

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

### Methods inherited from interface org.springframework.data.domain.Pageable

`getSortOr, isPaged, isUnpaged, toOptional, unpaged`

### Constructor Detail

#### QPageRequest

    @Deprecated
    public QPageRequest(int page,
                                    int size)

Deprecated. since 2.1, use `of(int, int)` instead.
Creates a new `QPageRequest`. Pages are zero indexed, thus providing 0 for `page` will return the first page.

Parameters:
  `page` - must not be negative.
  `size` - must be greater or equal to 0.

#### QPageRequest

    @Deprecated
    public QPageRequest(int page,
                                    int size,
                                    com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers)

Deprecated. since 2.1, use `of(int, int, OrderSpecifier...)` instead.
Creates a new `QPageRequest` with the given `OrderSpecifier`s applied.

Parameters:
  `page` - must not be negative.
  `size` - must be greater or equal to 0.
  `orderSpecifiers` - must not be null or empty;

#### QPageRequest

    @Deprecated
    public QPageRequest(int page,
                                    int size,
                                    QSort sort)

Deprecated. since 2.1, use `of(int, int, QSort)` instead.
Creates a new `QPageRequest` with sort parameters applied.

Parameters:
  `page` - must not be negative.
  `size` - must be greater or equal to 0.
  `sort` - must not be null.

### Method Detail

#### of

    public static QPageRequest of(int page,
                                  int size)

Creates a new `QPageRequest`. Pages are zero indexed, thus providing 0 for `page` will return the first page.

Parameters:
  `page` - must not be negative.
  `size` - must be greater or equal to 0.
Since:
  2.1

#### of

    public static QPageRequest of(int page,
                                  int size,
                                  com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers)

Creates a new `QPageRequest` with the given `OrderSpecifier`s applied.

Parameters:
  `page` - must not be negative.
  `size` - must be greater or equal to 0.
  `orderSpecifiers` - must not be null or empty;
Since:
  2.1

#### of

    public static QPageRequest of(int page,
                                  int size,
                                  QSort sort)

Creates a new `QPageRequest` with sort parameters applied.

Parameters:
  `page` - must not be negative.
  `size` - must be greater or equal to 0.
  `sort` - must not be null.
Since:
  2.1

#### getSort

    public Sort getSort()

Description copied from interface: `Pageable`
Returns the sorting parameters.

Returns:

#### next

    public Pageable next()

Description copied from interface: `Pageable`
Returns the `Pageable` requesting the next `Page`.

Specified by:
  `next` in interface `Pageable`
Specified by:
  `next` in class `AbstractPageRequest`
Returns:

#### previous

    public Pageable previous()

Description copied from class: `AbstractPageRequest`
Returns the `Pageable` requesting the previous `Page`.

Specified by:
  `previous` in class `AbstractPageRequest`
Returns:

#### first

    public Pageable first()

Description copied from interface: `Pageable`
Returns the `Pageable` requesting the first page.

Specified by:
  `first` in interface `Pageable`
Specified by:
  `first` in class `AbstractPageRequest`
Returns: