Package org.appng.api.rest
Class RestClient.Pageable
- java.lang.Object
-
- org.appng.api.rest.RestClient.Pageable
-
- Enclosing class:
- RestClient
public static class RestClient.Pageable extends Object
Wraps paging and sorting
-
-
Constructor Summary
Constructors Constructor Description Pageable(int page, int pageSize)
Creates a new pageable without any sortingPageable(int page, int pageSize, boolean reset)
Creates a new pageable without any sortingPageable(int page, int pageSize, String field, Sort.OrderEnum order)
Creates a new pageablePageable(int page, int pageSize, String field, Sort.OrderEnum order, boolean reset)
Creates a new pageable
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RestClient.Pageable
addSort(String field, Sort.OrderEnum direction)
Adds a sort criteria for the given field.String
getSortQuery()
Creates a query string (matrix-parameter style) containing all the sort criteria
-
-
-
Constructor Detail
-
Pageable
public Pageable(int page, int pageSize)
Creates a new pageable without any sorting- Parameters:
page
- the zero-indexed page numberpageSize
- the size of a page
-
Pageable
public Pageable(int page, int pageSize, boolean reset)
Creates a new pageable without any sorting- Parameters:
page
- the zero-indexed page numberpageSize
- the size of a pagereset
- set totrue
to reset current sort criteria
-
Pageable
public Pageable(int page, int pageSize, String field, Sort.OrderEnum order)
Creates a new pageable- Parameters:
page
- the zero-indexed page numberpageSize
- the size of a pagefield
- the field to sortorder
- the direction to sort
-
Pageable
public Pageable(int page, int pageSize, String field, Sort.OrderEnum order, boolean reset)
Creates a new pageable- Parameters:
page
- the zero-indexed page numberpageSize
- the size of a pagefield
- the field to sortorder
- the direction to sortreset
- set totrue
to reset current sort criteria
-
-
Method Detail
-
addSort
public RestClient.Pageable addSort(String field, Sort.OrderEnum direction)
Adds a sort criteria for the given field.- Parameters:
field
- the field to sortdirection
- the direction to sort- Returns:
- this
RestClient.Pageable
-
getSortQuery
public String getSortQuery()
Creates a query string (matrix-parameter style) containing all the sort criteria- Returns:
- the query string
-
-