28
28
import org .springframework .lang .Nullable ;
29
29
import org .springframework .util .Assert ;
30
30
31
- import java .util .ArrayList ;
32
- import java .util .Arrays ;
33
- import java .util .Collection ;
34
- import java .util .Collections ;
35
- import java .util .List ;
36
-
37
31
/**
38
32
* Sort option for queries that wraps JPA meta-model {@link Attribute}s for sorting.
39
33
*
@@ -48,7 +42,7 @@ public class JpaSort extends Sort {
48
42
private static final long serialVersionUID = 1L ;
49
43
50
44
private JpaSort (Direction direction , List <Path <?, ?>> paths ) {
51
- this (Collections .<Order >emptyList (), direction , paths );
45
+ this (Collections .<Order > emptyList (), direction , paths );
52
46
}
53
47
54
48
private JpaSort (List <Order > orders , @ Nullable Direction direction , List <Path <?, ?>> paths ) {
@@ -73,14 +67,14 @@ public static JpaSort of(Attribute<?, ?>... attributes) {
73
67
*
74
68
* @param paths must not be {@literal null} or empty.
75
69
*/
76
- public static JpaSort of (JpaSort . Path <?, ?>... paths ) {
70
+ public static JpaSort of (Path <?, ?>... paths ) {
77
71
return new JpaSort (DEFAULT_DIRECTION , Arrays .asList (paths ));
78
72
}
79
73
80
74
/**
81
75
* Creates a new {@link JpaSort} for the given direction and attributes.
82
76
*
83
- * @param direction the sorting direction.
77
+ * @param direction the sorting direction.
84
78
* @param attributes must not be {@literal null} or empty.
85
79
*/
86
80
public static JpaSort of (Direction direction , Attribute <?, ?>... attributes ) {
@@ -91,7 +85,7 @@ public static JpaSort of(Direction direction, Attribute<?, ?>... attributes) {
91
85
* Creates a new {@link JpaSort} for the given direction and {@link Path}s.
92
86
*
93
87
* @param direction the sorting direction.
94
- * @param paths must not be {@literal null} or empty.
88
+ * @param paths must not be {@literal null} or empty.
95
89
*/
96
90
public static JpaSort of (Direction direction , Path <?, ?>... paths ) {
97
91
return new JpaSort (direction , Arrays .asList (paths ));
@@ -100,7 +94,7 @@ public static JpaSort of(Direction direction, Path<?, ?>... paths) {
100
94
/**
101
95
* Returns a new {@link JpaSort} with the given sorting criteria added to the current one.
102
96
*
103
- * @param direction can be {@literal null}.
97
+ * @param direction can be {@literal null}.
104
98
* @param attributes must not be {@literal null}.
105
99
* @return
106
100
*/
@@ -115,7 +109,7 @@ public JpaSort and(@Nullable Direction direction, Attribute<?, ?>... attributes)
115
109
* Returns a new {@link JpaSort} with the given sorting criteria added to the current one.
116
110
*
117
111
* @param direction can be {@literal null}.
118
- * @param paths must not be {@literal null}.
112
+ * @param paths must not be {@literal null}.
119
113
* @return
120
114
*/
121
115
public JpaSort and (@ Nullable Direction direction , Path <?, ?>... paths ) {
@@ -134,7 +128,7 @@ public JpaSort and(@Nullable Direction direction, Path<?, ?>... paths) {
134
128
/**
135
129
* Returns a new {@link JpaSort} with the given sorting criteria added to the current one.
136
130
*
137
- * @param direction can be {@literal null}.
131
+ * @param direction can be {@literal null}.
138
132
* @param properties must not be {@literal null} or empty.
139
133
* @return
140
134
*/
@@ -152,7 +146,7 @@ public JpaSort andUnsafe(@Nullable Direction direction, String... properties) {
152
146
orders .add (new JpaOrder (direction , property ));
153
147
}
154
148
155
- return new JpaSort (orders , direction , Collections .<Path <?, ?>>emptyList ());
149
+ return new JpaSort (orders , direction , Collections .<Path <?, ?>> emptyList ());
156
150
}
157
151
158
152
/**
@@ -223,7 +217,7 @@ public static JpaSort unsafe(String... properties) {
223
217
/**
224
218
* Creates new unsafe {@link JpaSort} based on given {@link Direction} and properties.
225
219
*
226
- * @param direction must not be {@literal null}.
220
+ * @param direction must not be {@literal null}.
227
221
* @param properties must not be {@literal null} or empty.
228
222
* @return
229
223
*/
@@ -239,7 +233,7 @@ public static JpaSort unsafe(Direction direction, String... properties) {
239
233
/**
240
234
* Creates new unsafe {@link JpaSort} based on given {@link Direction} and properties.
241
235
*
242
- * @param direction must not be {@literal null}.
236
+ * @param direction must not be {@literal null}.
243
237
* @param properties must not be {@literal null} or empty.
244
238
* @return
245
239
*/
@@ -331,7 +325,7 @@ public static class JpaOrder extends Order {
331
325
* {@link Sort#DEFAULT_DIRECTION}
332
326
*
333
327
* @param direction can be {@literal null}, will default to {@link Sort#DEFAULT_DIRECTION}.
334
- * @param property must not be {@literal null}.
328
+ * @param property must not be {@literal null}.
335
329
*/
336
330
private JpaOrder (@ Nullable Direction direction , String property ) {
337
331
this (direction , property , NullHandling .NATIVE );
@@ -341,16 +335,16 @@ private JpaOrder(@Nullable Direction direction, String property) {
341
335
* Creates a new {@link Order} instance. if order is {@literal null} then order defaults to
342
336
* {@link Sort#DEFAULT_DIRECTION}.
343
337
*
344
- * @param direction can be {@literal null}, will default to {@link Sort#DEFAULT_DIRECTION}.
345
- * @param property must not be {@literal null}.
338
+ * @param direction can be {@literal null}, will default to {@link Sort#DEFAULT_DIRECTION}.
339
+ * @param property must not be {@literal null}.
346
340
* @param nullHandlingHint can be {@literal null}, will default to {@link NullHandling#NATIVE}.
347
341
*/
348
342
private JpaOrder (@ Nullable Direction direction , String property , NullHandling nullHandlingHint ) {
349
343
this (direction , property , false , nullHandlingHint , true );
350
344
}
351
345
352
346
private JpaOrder (@ Nullable Direction direction , String property , boolean ignoreCase , NullHandling nullHandling ,
353
- boolean unsafe ) {
347
+ boolean unsafe ) {
354
348
355
349
super (direction , property , ignoreCase , nullHandling );
356
350
this .unsafe = unsafe ;
0 commit comments