DATACMNS-1021 - Add Order.asc(…) and Order.desc(…) factory methods.
We now support Order creation with Order.asc(String) and Order.desc(String) factory methods as shortcut to constructor creation via new Order(Direction, String).
Sort.by(Order.asc("age"), Order.desc("name"));
Deprecated Order(String) constructor in favor of the Order.by(String) factory method. Replace references to new Order(String) with Order.by(String).
Original pull request: #211.
This commit is contained in:
committed by
Oliver Gierke
parent
78374f3cb7
commit
14647f9192
@@ -238,7 +238,7 @@ public class SortHandlerMethodArgumentResolver implements SortArgumentResolver {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
return Optional.of(direction.map(it -> new Order(it, property)).orElseGet(() -> new Order(property)));
|
||||
return Optional.of(direction.map(it -> new Order(it, property)).orElseGet(() -> Order.by(property)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user