20
20
* #L%
21
21
*/
22
22
23
+ import java .time .Instant ;
23
24
import java .util .Arrays ;
25
+ import java .util .Calendar ;
26
+ import java .util .Date ;
24
27
25
28
/**
26
29
* Helper to create Filter
@@ -88,6 +91,48 @@ public static Filter gt(final String fieldName, final Number value) {
88
91
return new Filter ().where (fieldName ).isGreaterThan (value );
89
92
}
90
93
94
+ /**
95
+ * Creates a filter that matches all documents where the value of the given field is greater than the specified value.
96
+ *
97
+ * @param fieldName
98
+ * the field name
99
+ * @param value
100
+ * the value, which may be null
101
+ *
102
+ * @return the filter
103
+ */
104
+ public static Filter gt (final String fieldName , final Instant value ) {
105
+ return new Filter ().where (fieldName ).isGreaterThan (value );
106
+ }
107
+
108
+ /**
109
+ * Creates a filter that matches all documents where the value of the given field is greater than the specified value.
110
+ *
111
+ * @param fieldName
112
+ * the field name
113
+ * @param value
114
+ * the value, which may be null
115
+ *
116
+ * @return the filter
117
+ */
118
+ public static Filter gt (final String fieldName , final Date value ) {
119
+ return new Filter ().where (fieldName ).isGreaterThan (value );
120
+ }
121
+
122
+ /**
123
+ * Creates a filter that matches all documents where the value of the given field is greater than the specified value.
124
+ *
125
+ * @param fieldName
126
+ * the field name
127
+ * @param value
128
+ * the value, which may be null
129
+ *
130
+ * @return the filter
131
+ */
132
+ public static Filter gt (final String fieldName , final Calendar value ) {
133
+ return new Filter ().where (fieldName ).isGreaterThan (value );
134
+ }
135
+
91
136
/**
92
137
* Creates a filter that matches all documents where the value of the given field is greater than or equal to the specified value.
93
138
*
@@ -102,6 +147,48 @@ public static Filter gte(final String fieldName, final Number value) {
102
147
return new Filter ().where (fieldName ).isGreaterOrEqualsThan (value );
103
148
}
104
149
150
+ /**
151
+ * Creates a filter that matches all documents where the value of the given field is greater than or equal to the specified value.
152
+ *
153
+ * @param fieldName
154
+ * the field name
155
+ * @param value
156
+ * the value, which may be null
157
+ *
158
+ * @return the filter
159
+ */
160
+ public static Filter gte (final String fieldName , final Instant value ) {
161
+ return new Filter ().where (fieldName ).isGreaterOrEqualsThan (value );
162
+ }
163
+
164
+ /**
165
+ * Creates a filter that matches all documents where the value of the given field is greater than or equal to the specified value.
166
+ *
167
+ * @param fieldName
168
+ * the field name
169
+ * @param value
170
+ * the value, which may be null
171
+ *
172
+ * @return the filter
173
+ */
174
+ public static Filter gte (final String fieldName , final Calendar value ) {
175
+ return new Filter ().where (fieldName ).isGreaterOrEqualsThan (value );
176
+ }
177
+
178
+ /**
179
+ * Creates a filter that matches all documents where the value of the given field is greater than or equal to the specified value.
180
+ *
181
+ * @param fieldName
182
+ * the field name
183
+ * @param value
184
+ * the value, which may be null
185
+ *
186
+ * @return the filter
187
+ */
188
+ public static Filter gte (final String fieldName , final Date value ) {
189
+ return new Filter ().where (fieldName ).isGreaterOrEqualsThan (value );
190
+ }
191
+
105
192
/**
106
193
* Creates a filter that matches all documents where the value of the given field is less than the specified value.
107
194
*
@@ -116,6 +203,48 @@ public static Filter lt(final String fieldName, final Number value) {
116
203
return new Filter ().where (fieldName ).isLessThan (value );
117
204
}
118
205
206
+ /**
207
+ * Creates a filter that matches all documents where the value of the given field is less than the specified value.
208
+ *
209
+ * @param fieldName
210
+ * the field name
211
+ * @param value
212
+ * the value, which may be null
213
+ *
214
+ * @return the filter
215
+ */
216
+ public static Filter lt (final String fieldName , final Date value ) {
217
+ return new Filter ().where (fieldName ).isLessThan (value );
218
+ }
219
+
220
+ /**
221
+ * Creates a filter that matches all documents where the value of the given field is less than the specified value.
222
+ *
223
+ * @param fieldName
224
+ * the field name
225
+ * @param value
226
+ * the value, which may be null
227
+ *
228
+ * @return the filter
229
+ */
230
+ public static Filter lt (final String fieldName , final Instant value ) {
231
+ return new Filter ().where (fieldName ).isLessThan (value );
232
+ }
233
+
234
+ /**
235
+ * Creates a filter that matches all documents where the value of the given field is less than the specified value.
236
+ *
237
+ * @param fieldName
238
+ * the field name
239
+ * @param value
240
+ * the value, which may be null
241
+ *
242
+ * @return the filter
243
+ */
244
+ public static Filter lt (final String fieldName , final Calendar value ) {
245
+ return new Filter ().where (fieldName ).isLessThan (value );
246
+ }
247
+
119
248
/**
120
249
* Creates a filter that matches all documents where the value of the given field is less than or equal to the specified value.
121
250
*
@@ -130,6 +259,48 @@ public static Filter lte(final String fieldName, final Number value) {
130
259
return new Filter ().where (fieldName , FilterOperator .LESS_THAN_OR_EQUALS_TO , value );
131
260
}
132
261
262
+ /**
263
+ * Creates a filter that matches all documents where the value of the given field is less than or equal to the specified value.
264
+ *
265
+ * @param fieldName
266
+ * the field name
267
+ * @param value
268
+ * the value, which may be null
269
+ *
270
+ * @return the filter
271
+ */
272
+ public static Filter lte (final String fieldName , final Instant value ) {
273
+ return new Filter ().where (fieldName , FilterOperator .LESS_THAN_OR_EQUALS_TO , value );
274
+ }
275
+
276
+ /**
277
+ * Creates a filter that matches all documents where the value of the given field is less than or equal to the specified value.
278
+ *
279
+ * @param fieldName
280
+ * the field name
281
+ * @param value
282
+ * the value, which may be null
283
+ *
284
+ * @return the filter
285
+ */
286
+ public static Filter lte (final String fieldName , final Date value ) {
287
+ return new Filter ().where (fieldName , FilterOperator .LESS_THAN_OR_EQUALS_TO , value );
288
+ }
289
+
290
+ /**
291
+ * Creates a filter that matches all documents where the value of the given field is less than or equal to the specified value.
292
+ *
293
+ * @param fieldName
294
+ * the field name
295
+ * @param value
296
+ * the value, which may be null
297
+ *
298
+ * @return the filter
299
+ */
300
+ public static Filter lte (final String fieldName , final Calendar value ) {
301
+ return new Filter ().where (fieldName , FilterOperator .LESS_THAN_OR_EQUALS_TO , value );
302
+ }
303
+
133
304
/**
134
305
* Build a filter with the `$hasSize` operator.
135
306
*
0 commit comments