Package org.apache.cayenne.query
Class Orderings
- All Implemented Interfaces:
- Serializable,- Cloneable,- Iterable<Ordering>,- Collection<Ordering>,- List<Ordering>,- RandomAccess
public class Orderings extends ArrayList<Ordering>
Orderings is provided so that you can chain Ordering together and then use the result to pass into methods that require List<Ordering>
Example:
Person.COMPANY_NAME.asc().then(Person.FIRST_NAME.desc)
- Since:
- 4.1
- See Also:
- Serialized Form
- 
Field SummaryFields inherited from class java.util.AbstractListmodCount
- 
Constructor Summary
- 
Method SummaryModifier and Type Method Description <T> List<T>orderedList(List<T> list)Returns an list sorted with these Orderings.<T> voidorderList(List<T> list)Sorts the given array with these Orderings.Orderingsthen(List<Ordering> nextOrderings)Orderingsthen(Ordering nextOrdering)Adds the given sort ordering to the end of this list and returns "this" so it can be chained again.Orderingsthen(Orderings nextOrderings)Adds the given sort orderings to the end of this list and returns "this" so it can be chained again.Methods inherited from class java.util.ArrayListadd, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollectioncontainsAll, toStringMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.CollectionparallelStream, stream, toArrayMethods inherited from interface java.util.ListcontainsAll
- 
Constructor Details- 
Orderingspublic Orderings()
- 
Orderingspublic Orderings(int initialCapacity)
- 
Orderings
- 
Orderings
- 
Orderings
 
- 
- 
Method Details- 
thenAdds the given sort ordering to the end of this list and returns "this" so it can be chained again.- Parameters:
- nextOrdering- the sort ordering to add
- Returns:
- this (with nextOrdering appended)
 
- 
thenAdds the given sort orderings to the end of this list and returns "this" so it can be chained again.- Parameters:
- nextOrderings- the sort ordering to add
- Returns:
- this (with nextOrderings appended)
 
- 
then- Parameters:
- nextOrderings- the sort ordering to add
- Returns:
- this
- See Also:
- then(Orderings)
 
- 
orderedListReturns an list sorted with these Orderings.- Type Parameters:
- T- the type of the list
- Parameters:
- list- the list to sort
- Returns:
- a sorted copy of the list
 
- 
orderListSorts the given array with these Orderings.- Type Parameters:
- T- the type of the list
- Parameters:
- list- the list to sort
 
 
-