33
33
/**
34
34
* An individual write operation to be executed as part of a client-level bulk write operation.
35
35
*
36
- * @param <T> The document type, for example {@link Document}.
37
36
* @since 5.3
38
37
*/
39
- // BULK-TODO I don't think T is needed
40
38
@ Sealed
41
- public interface ClientWriteModel < T > {
39
+ public interface ClientWriteModel {
42
40
/**
43
41
* Creates a model for inserting the {@code document} into the {@code namespace}.
44
42
*
45
43
* @param namespace The namespace.
46
44
* @param document The document.
47
45
* @return The requested model.
48
- * @param <T > The document type, for example {@link Document}.
46
+ * @param <TDocument > The document type, for example {@link Document}.
49
47
* @see Filters
50
48
*/
51
- static <T > ClientWriteModel < T > insertOne (
49
+ static <TDocument > ClientWriteModel insertOne (
52
50
final MongoNamespace namespace ,
53
- final T document ) {
51
+ final TDocument document ) {
54
52
notNull ("namespace" , namespace );
55
53
notNull ("document" , document );
56
- return new ClientInsertOneModel <> (namespace , document );
54
+ return new ClientInsertOneModel (namespace , document );
57
55
}
58
56
59
57
/**
@@ -65,18 +63,17 @@ static <T> ClientWriteModel<T> insertOne(
65
63
* @param filter The filter.
66
64
* @param update The update.
67
65
* @return The requested model.
68
- * @param <T> The document type, for example {@link Document}.
69
66
* @see Filters
70
67
* @see Updates
71
68
*/
72
- static < T > ClientWriteModel < T > updateOne (
69
+ static ClientWriteModel updateOne (
73
70
final MongoNamespace namespace ,
74
71
final Bson filter ,
75
72
final Bson update ) {
76
73
notNull ("namespace" , namespace );
77
74
notNull ("filter" , filter );
78
75
notNull ("update" , update );
79
- return new ClientUpdateOneModel <> (namespace , filter , update , null , null );
76
+ return new ClientUpdateOneModel (namespace , filter , update , null , null );
80
77
}
81
78
82
79
/**
@@ -87,11 +84,10 @@ static <T> ClientWriteModel<T> updateOne(
87
84
* @param update The update.
88
85
* @param options The options.
89
86
* @return The requested model.
90
- * @param <T> The document type, for example {@link Document}.
91
87
* @see Filters
92
88
* @see Updates
93
89
*/
94
- static < T > ClientWriteModel < T > updateOne (
90
+ static ClientWriteModel updateOne (
95
91
final MongoNamespace namespace ,
96
92
final Bson filter ,
97
93
final Bson update ,
@@ -100,7 +96,7 @@ static <T> ClientWriteModel<T> updateOne(
100
96
notNull ("filter" , filter );
101
97
notNull ("update" , update );
102
98
notNull ("options" , options );
103
- return new ClientUpdateOneModel <> (namespace , filter , update , null , options );
99
+ return new ClientUpdateOneModel (namespace , filter , update , null , options );
104
100
}
105
101
106
102
/**
@@ -112,18 +108,17 @@ static <T> ClientWriteModel<T> updateOne(
112
108
* @param filter The filter.
113
109
* @param updatePipeline The update pipeline.
114
110
* @return The requested model.
115
- * @param <T> The document type, for example {@link Document}.
116
111
* @see Filters
117
112
* @see Updates
118
113
*/
119
- static < T > ClientWriteModel < T > updateOne (
114
+ static ClientWriteModel updateOne (
120
115
final MongoNamespace namespace ,
121
116
final Bson filter ,
122
117
final Iterable <? extends Bson > updatePipeline ) {
123
118
notNull ("namespace" , namespace );
124
119
notNull ("filter" , filter );
125
120
notNull ("updatePipeline" , updatePipeline );
126
- return new ClientUpdateOneModel <> (namespace , filter , null , updatePipeline , null );
121
+ return new ClientUpdateOneModel (namespace , filter , null , updatePipeline , null );
127
122
}
128
123
129
124
/**
@@ -134,11 +129,10 @@ static <T> ClientWriteModel<T> updateOne(
134
129
* @param updatePipeline The update pipeline.
135
130
* @param options The options.
136
131
* @return The requested model.
137
- * @param <T> The document type, for example {@link Document}.
138
132
* @see Filters
139
133
* @see Updates
140
134
*/
141
- static < T > ClientWriteModel < T > updateOne (
135
+ static ClientWriteModel updateOne (
142
136
final MongoNamespace namespace ,
143
137
final Bson filter ,
144
138
final Iterable <? extends Bson > updatePipeline ,
@@ -147,7 +141,7 @@ static <T> ClientWriteModel<T> updateOne(
147
141
notNull ("filter" , filter );
148
142
notNull ("updatePipeline" , updatePipeline );
149
143
notNull ("options" , options );
150
- return new ClientUpdateOneModel <> (namespace , filter , null , updatePipeline , options );
144
+ return new ClientUpdateOneModel (namespace , filter , null , updatePipeline , options );
151
145
}
152
146
153
147
/**
@@ -159,18 +153,17 @@ static <T> ClientWriteModel<T> updateOne(
159
153
* @param filter The filter.
160
154
* @param update The update.
161
155
* @return The requested model.
162
- * @param <T> The document type, for example {@link Document}.
163
156
* @see Filters
164
157
* @see Updates
165
158
*/
166
- static < T > ClientWriteModel < T > updateMany (
159
+ static ClientWriteModel updateMany (
167
160
final MongoNamespace namespace ,
168
161
final Bson filter ,
169
162
final Bson update ) {
170
163
notNull ("namespace" , namespace );
171
164
notNull ("filter" , filter );
172
165
notNull ("update" , update );
173
- return new ClientUpdateManyModel <> (namespace , filter , update , null , null );
166
+ return new ClientUpdateManyModel (namespace , filter , update , null , null );
174
167
}
175
168
176
169
/**
@@ -181,11 +174,10 @@ static <T> ClientWriteModel<T> updateMany(
181
174
* @param update The update.
182
175
* @param options The options.
183
176
* @return The requested model.
184
- * @param <T> The document type, for example {@link Document}.
185
177
* @see Filters
186
178
* @see Updates
187
179
*/
188
- static < T > ClientWriteModel < T > updateMany (
180
+ static ClientWriteModel updateMany (
189
181
final MongoNamespace namespace ,
190
182
final Bson filter ,
191
183
final Bson update ,
@@ -194,7 +186,7 @@ static <T> ClientWriteModel<T> updateMany(
194
186
notNull ("filter" , filter );
195
187
notNull ("update" , update );
196
188
notNull ("options" , options );
197
- return new ClientUpdateManyModel <> (namespace , filter , update , null , options );
189
+ return new ClientUpdateManyModel (namespace , filter , update , null , options );
198
190
}
199
191
200
192
/**
@@ -206,18 +198,17 @@ static <T> ClientWriteModel<T> updateMany(
206
198
* @param filter The filter.
207
199
* @param updatePipeline The update pipeline.
208
200
* @return The requested model.
209
- * @param <T> The document type, for example {@link Document}.
210
201
* @see Filters
211
202
* @see Updates
212
203
*/
213
- static < T > ClientWriteModel < T > updateMany (
204
+ static ClientWriteModel updateMany (
214
205
final MongoNamespace namespace ,
215
206
final Bson filter ,
216
207
final Iterable <? extends Bson > updatePipeline ) {
217
208
notNull ("namespace" , namespace );
218
209
notNull ("filter" , filter );
219
210
notNull ("updatePipeline" , updatePipeline );
220
- return new ClientUpdateManyModel <> (namespace , filter , null , updatePipeline , null );
211
+ return new ClientUpdateManyModel (namespace , filter , null , updatePipeline , null );
221
212
}
222
213
223
214
/**
@@ -228,11 +219,10 @@ static <T> ClientWriteModel<T> updateMany(
228
219
* @param updatePipeline The update pipeline.
229
220
* @param options The options.
230
221
* @return The requested model.
231
- * @param <T> The document type, for example {@link Document}.
232
222
* @see Filters
233
223
* @see Updates
234
224
*/
235
- static < T > ClientWriteModel < T > updateMany (
225
+ static ClientWriteModel updateMany (
236
226
final MongoNamespace namespace ,
237
227
final Bson filter ,
238
228
final Iterable <? extends Bson > updatePipeline ,
@@ -241,7 +231,7 @@ static <T> ClientWriteModel<T> updateMany(
241
231
notNull ("filter" , filter );
242
232
notNull ("updatePipeline" , updatePipeline );
243
233
notNull ("options" , options );
244
- return new ClientUpdateManyModel <> (namespace , filter , null , updatePipeline , options );
234
+ return new ClientUpdateManyModel (namespace , filter , null , updatePipeline , options );
245
235
}
246
236
247
237
/**
@@ -253,17 +243,17 @@ static <T> ClientWriteModel<T> updateMany(
253
243
* @param filter The filter.
254
244
* @param replacement The replacement.
255
245
* @return The requested model.
256
- * @param <T > The document type, for example {@link Document}.
246
+ * @param <TDocument > The document type, for example {@link Document}.
257
247
* @see Filters
258
248
*/
259
- static <T > ClientWriteModel < T > replaceOne (
249
+ static <TDocument > ClientWriteModel replaceOne (
260
250
final MongoNamespace namespace ,
261
251
final Bson filter ,
262
- final T replacement ) {
252
+ final TDocument replacement ) {
263
253
notNull ("namespace" , namespace );
264
254
notNull ("filter" , filter );
265
255
notNull ("replacement" , replacement );
266
- return new ClientReplaceOneModel <> (namespace , filter , replacement , null );
256
+ return new ClientReplaceOneModel (namespace , filter , replacement , null );
267
257
}
268
258
269
259
/**
@@ -274,19 +264,19 @@ static <T> ClientWriteModel<T> replaceOne(
274
264
* @param replacement The replacement.
275
265
* @param options The options.
276
266
* @return The requested model.
277
- * @param <T > The document type, for example {@link Document}.
267
+ * @param <TDocument > The document type, for example {@link Document}.
278
268
* @see Filters
279
269
*/
280
- static <T > ClientWriteModel < T > replaceOne (
270
+ static <TDocument > ClientWriteModel replaceOne (
281
271
final MongoNamespace namespace ,
282
272
final Bson filter ,
283
- final T replacement ,
273
+ final TDocument replacement ,
284
274
final ClientReplaceOptions options ) {
285
275
notNull ("namespace" , namespace );
286
276
notNull ("filter" , filter );
287
277
notNull ("replacement" , replacement );
288
278
notNull ("options" , options );
289
- return new ClientReplaceOneModel <> (namespace , filter , replacement , options );
279
+ return new ClientReplaceOneModel (namespace , filter , replacement , options );
290
280
}
291
281
292
282
/**
@@ -297,15 +287,14 @@ static <T> ClientWriteModel<T> replaceOne(
297
287
* @param namespace The namespace.
298
288
* @param filter The filter.
299
289
* @return The requested model.
300
- * @param <T> The document type, for example {@link Document}.
301
290
* @see Filters
302
291
*/
303
- static < T > ClientWriteModel < T > deleteOne (
292
+ static ClientWriteModel deleteOne (
304
293
final MongoNamespace namespace ,
305
294
final Bson filter ) {
306
295
notNull ("namespace" , namespace );
307
296
notNull ("filter" , filter );
308
- return new ClientDeleteOneModel <> (namespace , filter , null );
297
+ return new ClientDeleteOneModel (namespace , filter , null );
309
298
}
310
299
311
300
/**
@@ -315,17 +304,16 @@ static <T> ClientWriteModel<T> deleteOne(
315
304
* @param filter The filter.
316
305
* @param options The options.
317
306
* @return The requested model.
318
- * @param <T> The document type, for example {@link Document}.
319
307
* @see Filters
320
308
*/
321
- static < T > ClientWriteModel < T > deleteOne (
309
+ static ClientWriteModel deleteOne (
322
310
final MongoNamespace namespace ,
323
311
final Bson filter ,
324
312
final ClientDeleteOptions options ) {
325
313
notNull ("namespace" , namespace );
326
314
notNull ("filter" , filter );
327
315
notNull ("options" , options );
328
- return new ClientDeleteOneModel <> (namespace , filter , options );
316
+ return new ClientDeleteOneModel (namespace , filter , options );
329
317
}
330
318
331
319
/**
@@ -336,15 +324,14 @@ static <T> ClientWriteModel<T> deleteOne(
336
324
* @param namespace The namespace.
337
325
* @param filter The filter.
338
326
* @return The requested model.
339
- * @param <T> The document type, for example {@link Document}.
340
327
* @see Filters
341
328
*/
342
- static < T > ClientWriteModel < T > deleteMany (
329
+ static ClientWriteModel deleteMany (
343
330
final MongoNamespace namespace ,
344
331
final Bson filter ) {
345
332
notNull ("namespace" , namespace );
346
333
notNull ("filter" , filter );
347
- return new ClientDeleteManyModel <> (namespace , filter , null );
334
+ return new ClientDeleteManyModel (namespace , filter , null );
348
335
}
349
336
350
337
/**
@@ -354,16 +341,15 @@ static <T> ClientWriteModel<T> deleteMany(
354
341
* @param filter The filter.
355
342
* @param options The options.
356
343
* @return The requested model.
357
- * @param <T> The document type, for example {@link Document}.
358
344
* @see Filters
359
345
*/
360
- static < T > ClientWriteModel < T > deleteMany (
346
+ static ClientWriteModel deleteMany (
361
347
final MongoNamespace namespace ,
362
348
final Bson filter ,
363
349
final ClientDeleteOptions options ) {
364
350
notNull ("namespace" , namespace );
365
351
notNull ("filter" , filter );
366
352
notNull ("options" , options );
367
- return new ClientDeleteManyModel <> (namespace , filter , options );
353
+ return new ClientDeleteManyModel (namespace , filter , options );
368
354
}
369
355
}
0 commit comments