public final class OrderBy<T> extends Object implements Serializable
Is a ordered list of OrderBy.Property objects each specifying a property and whether it is ascending or descending order.
Typically you will not construct an OrderBy yourself but use one that exists on the Query object.
Modifier and Type | Class and Description |
---|---|
static class |
OrderBy.Property
A property and its ascending descending order.
|
Constructor and Description |
---|
OrderBy()
Create an empty OrderBy with no associated query.
|
OrderBy(Query<T> query,
String orderByClause)
Construct with a given query and order by clause.
|
OrderBy(String orderByClause)
Create an orderBy parsing the order by clause.
|
Modifier and Type | Method and Description |
---|---|
void |
add(OrderBy.Property p)
Add a property to the order by.
|
Query<T> |
asc(String propertyName)
Add a property with ascending order to this OrderBy.
|
OrderBy<T> |
copy()
Return a copy of the OrderBy.
|
OrderBy<T> |
copyWithTrim(String path)
Return a copy of this OrderBy with the path trimmed.
|
Query<T> |
desc(String propertyName)
Add a property with descending order to this OrderBy.
|
boolean |
equals(Object obj) |
List<OrderBy.Property> |
getProperties()
Return the properties for this OrderBy.
|
Query<T> |
getQuery()
Return the associated query if there is one.
|
int |
hashCode()
Return a hash value for this OrderBy.
|
boolean |
isEmpty()
Return true if this OrderBy does not have any properties.
|
void |
reverse()
Reverse the ascending/descending order on all the properties.
|
void |
setQuery(Query<T> query)
Associate this OrderBy with a query.
|
String |
toString() |
String |
toStringFormat()
Returns the OrderBy in string format.
|
public OrderBy()
public OrderBy(String orderByClause)
The order by clause follows SQL order by clause with comma's between each property and optionally "asc" or "desc" to represent ascending or descending order respectively.
public void reverse()
public Query<T> desc(String propertyName)
public OrderBy<T> copyWithTrim(String path)
public List<OrderBy.Property> getProperties()
public boolean isEmpty()
public void add(OrderBy.Property p)
public String toStringFormat()
Copyright © 2015. All Rights Reserved.