Class Sort
java.lang.Object
com.blazebit.persistence.deltaspike.data.Sort
- All Implemented Interfaces:
Serializable,Iterable<Sort.Order>
Immutable container for sorting information, heavily inspired by Spring Data's
Sort.- Since:
- 1.2.0
- Author:
- Christian Beikov
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSort directions.static enumEnumeration for null handling of anSort.Order.static classPropertyPath implements the pairing of anSort.Directionand a property. -
Constructor Summary
ConstructorsConstructorDescriptionSort(Sort.Direction direction, String... paths) Creates a new Sort with the given paths the given direction.Sort(Sort.Direction direction, List<String> paths) Creates a new Sort with the given paths and given direction.Sort(Sort.Order... orders) Creates a new Sort with the givenSort.Orders.Creates a new Sort with the given paths and theSort.Direction.ASC.Sort(Collection<Sort.Order> orders) Creates a new Sort with the givenSort.Orders. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetOrderFor(String path) Returns the order for the given path ornullif there is none.inthashCode()iterator()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Sort
Creates a new Sort with the givenSort.Orders.- Parameters:
orders- The orders to use for sorting
-
Sort
Creates a new Sort with the givenSort.Orders.- Parameters:
orders- The orders to use for sorting
-
Sort
Creates a new Sort with the given paths and theSort.Direction.ASC.- Parameters:
paths- The paths by which to sort
-
Sort
Creates a new Sort with the given paths the given direction.- Parameters:
direction- The direction to use for sortingpaths- The paths by which to sort
-
Sort
Creates a new Sort with the given paths and given direction.- Parameters:
direction- The direction to use for sortingpaths- The paths by which to sort
-
-
Method Details
-
and
- Parameters:
sort- The other sort, may be null- Returns:
- A new Sort with the union of this and the
Sort.Orders of the givenSort
-
getOrderFor
Returns the order for the given path ornullif there is none.- Parameters:
path- The path for which to get theSort.Order- Returns:
- The
Sort.Orderfor the given path ornullit there is none
-
iterator
- Specified by:
iteratorin interfaceIterable<Sort.Order>
-
equals
-
hashCode
public int hashCode() -
toString
-