public class SortCriteria extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
SortCriteria.Ordering
Represents the types of ordering that may occur when sorting
with the
BeanSorter . |
Constructor and Description |
---|
SortCriteria(String sortBy)
Creates a SortCriteria object with the default ascending ordering and nulls
placed first.
|
SortCriteria(String sortBy,
boolean nullsFirst)
Creates a new instance of this SortCriteria class.
|
SortCriteria(String sortBy,
SortCriteria.Ordering ordering)
Creates a new instance of this SortCriteria class.
|
SortCriteria(String sortBy,
SortCriteria.Ordering ordering,
boolean nullsFirst)
Creates a new instance of this SortCriteria class.
|
Modifier and Type | Method and Description |
---|---|
SortCriteria.Ordering |
getOrdering()
Gets the current ordering to be used.
|
String |
getSortBy()
Gets the sort by name.
|
boolean |
isNullsFirst() |
void |
setNullsFirst(boolean nullsFirst) |
void |
setOrdering(SortCriteria.Ordering ordering)
Sets the ordering to use for sorting.
|
void |
setSortBy(String sortBy)
Sets the name of the property by which to sort.
|
public SortCriteria(String sortBy)
sortBy
- the property to sort by, this can
be nested (i.e. person.name.firstName will be sorted).public SortCriteria(String sortBy, boolean nullsFirst)
sortBy
- the property to sort by, this can
be nested (i.e. person.name.firstName will be sorted).nullsFirst
- whether or not nulls will be placed first or last when sorting occurs.public SortCriteria(String sortBy, SortCriteria.Ordering ordering)
sortBy
- the property to sort by, this can
be nested (i.e. person.name.firstName will be sorted).ordering
- the ordering to sort by: SortCriteria.Ordering.ASCENDING
or SortCriteria.Ordering.DESCENDING
.public SortCriteria(String sortBy, SortCriteria.Ordering ordering, boolean nullsFirst)
sortBy
- the property to sort by, this can
be nested (i.e. person.name.firstName will be sorted).ordering
- the ordering to sort by: SortCriteria.Ordering.ASCENDING
or SortCriteria.Ordering.DESCENDING
.nullsFirst
- whether or not nulls will be placed first or last when sorting occurs.public SortCriteria.Ordering getOrdering()
public void setOrdering(SortCriteria.Ordering ordering)
ordering
- the ordering.public void setSortBy(String sortBy)
sortBy
- the name of the property by which to sort.public boolean isNullsFirst()
public void setNullsFirst(boolean nullsFirst)
nullsFirst
- the nullsFirst to setCopyright © 2003–2014 AndroMDA.org. All rights reserved.