public static class PaginationParameter.PaginationParameterBuilder extends Object
build()
method to create the
PaginationParameter
.Modifier and Type | Field and Description |
---|---|
protected List<PaginationOrder> |
orderClauses |
protected int |
pageNumber |
protected int |
pageSize |
Constructor and Description |
---|
PaginationParameterBuilder(int pageNumber,
int pageSize)
Creates a Builder instance
|
Modifier and Type | Method and Description |
---|---|
PaginationParameter.PaginationParameterBuilder |
addAscOrder(String clause)
Adds an ASC order clause
|
PaginationParameter.PaginationParameterBuilder |
addDescOrder(String clause)
Adds an DESC order clause
|
PaginationParameter.PaginationParameterBuilder |
addOrder(String clause)
Adds an order clause.
|
PaginationParameter.PaginationParameterBuilder |
addOrder(String clause,
boolean desc)
Adds an order clause
|
PaginationParameter.PaginationParameterBuilder |
addOrderClauses(Iterable<PaginationOrder> clauses)
Adds an the given order clauses
|
PaginationParameter |
build()
Final method that instantiates the immutable PaginationParameter
|
protected int pageNumber
protected int pageSize
protected List<PaginationOrder> orderClauses
public PaginationParameterBuilder(int pageNumber, int pageSize)
pageNumber
- the index (0-based) of the pagepageSize
- the size of each page. Value can be -1 (for infinite pageSize) or greater than 0public PaginationParameter.PaginationParameterBuilder addOrder(String clause, boolean desc)
clause
- an order clause attribute name. It comes together with {code}desc{/code}desc
- the asc/desc property associated with {code}clause{/code}public PaginationParameter.PaginationParameterBuilder addAscOrder(String clause)
clause
- an order clause attribute namepublic PaginationParameter.PaginationParameterBuilder addDescOrder(String clause)
clause
- an order clause attribute namepublic PaginationParameter.PaginationParameterBuilder addOrder(String clause)
clause
- an order clause attribute name. It comes together with {code}desc{/code}public PaginationParameter.PaginationParameterBuilder addOrderClauses(Iterable<PaginationOrder> clauses)
clauses
- an list of order clausespublic PaginationParameter build()
Copyright © 2004–2020 CodeLutin. All rights reserved.