@@ -75,7 +75,10 @@ public class DataLoader<K, V> {
75
75
* @param <V> the value type
76
76
*
77
77
* @return a new DataLoader
78
+ *
79
+ * @deprecated use {@link DataLoaderFactory} instead
78
80
*/
81
+ @ Deprecated
79
82
public static <K , V > DataLoader <K , V > newDataLoader (BatchLoader <K , V > batchLoadFunction ) {
80
83
return newDataLoader (batchLoadFunction , null );
81
84
}
@@ -89,9 +92,12 @@ public static <K, V> DataLoader<K, V> newDataLoader(BatchLoader<K, V> batchLoadF
89
92
* @param <V> the value type
90
93
*
91
94
* @return a new DataLoader
95
+ *
96
+ * @deprecated use {@link DataLoaderFactory} instead
92
97
*/
98
+ @ Deprecated
93
99
public static <K , V > DataLoader <K , V > newDataLoader (BatchLoader <K , V > batchLoadFunction , DataLoaderOptions options ) {
94
- return new DataLoader <> (batchLoadFunction , options );
100
+ return DataLoaderFactory . mkDataLoader (batchLoadFunction , options );
95
101
}
96
102
97
103
/**
@@ -110,7 +116,10 @@ public static <K, V> DataLoader<K, V> newDataLoader(BatchLoader<K, V> batchLoadF
110
116
* @param <V> the value type
111
117
*
112
118
* @return a new DataLoader
119
+ *
120
+ * @deprecated use {@link DataLoaderFactory} instead
113
121
*/
122
+ @ Deprecated
114
123
public static <K , V > DataLoader <K , V > newDataLoaderWithTry (BatchLoader <K , Try <V >> batchLoadFunction ) {
115
124
return newDataLoaderWithTry (batchLoadFunction , null );
116
125
}
@@ -127,11 +136,12 @@ public static <K, V> DataLoader<K, V> newDataLoaderWithTry(BatchLoader<K, Try<V>
127
136
*
128
137
* @return a new DataLoader
129
138
*
130
- * @see #newDataLoaderWithTry(BatchLoader)
139
+ * @see DataLoaderFactory#newDataLoaderWithTry(BatchLoader)
140
+ * @deprecated use {@link DataLoaderFactory} instead
131
141
*/
132
- @ SuppressWarnings ( "unchecked" )
142
+ @ Deprecated
133
143
public static <K , V > DataLoader <K , V > newDataLoaderWithTry (BatchLoader <K , Try <V >> batchLoadFunction , DataLoaderOptions options ) {
134
- return new DataLoader <>(( BatchLoader < K , V >) batchLoadFunction , options );
144
+ return DataLoaderFactory . mkDataLoader ( batchLoadFunction , options );
135
145
}
136
146
137
147
/**
@@ -143,7 +153,10 @@ public static <K, V> DataLoader<K, V> newDataLoaderWithTry(BatchLoader<K, Try<V>
143
153
* @param <V> the value type
144
154
*
145
155
* @return a new DataLoader
156
+ *
157
+ * @deprecated use {@link DataLoaderFactory} instead
146
158
*/
159
+ @ Deprecated
147
160
public static <K , V > DataLoader <K , V > newDataLoader (BatchLoaderWithContext <K , V > batchLoadFunction ) {
148
161
return newDataLoader (batchLoadFunction , null );
149
162
}
@@ -157,9 +170,12 @@ public static <K, V> DataLoader<K, V> newDataLoader(BatchLoaderWithContext<K, V>
157
170
* @param <V> the value type
158
171
*
159
172
* @return a new DataLoader
173
+ *
174
+ * @deprecated use {@link DataLoaderFactory} instead
160
175
*/
176
+ @ Deprecated
161
177
public static <K , V > DataLoader <K , V > newDataLoader (BatchLoaderWithContext <K , V > batchLoadFunction , DataLoaderOptions options ) {
162
- return new DataLoader <> (batchLoadFunction , options );
178
+ return DataLoaderFactory . mkDataLoader (batchLoadFunction , options );
163
179
}
164
180
165
181
/**
@@ -178,7 +194,10 @@ public static <K, V> DataLoader<K, V> newDataLoader(BatchLoaderWithContext<K, V>
178
194
* @param <V> the value type
179
195
*
180
196
* @return a new DataLoader
197
+ *
198
+ * @deprecated use {@link DataLoaderFactory} instead
181
199
*/
200
+ @ Deprecated
182
201
public static <K , V > DataLoader <K , V > newDataLoaderWithTry (BatchLoaderWithContext <K , Try <V >> batchLoadFunction ) {
183
202
return newDataLoaderWithTry (batchLoadFunction , null );
184
203
}
@@ -195,10 +214,12 @@ public static <K, V> DataLoader<K, V> newDataLoaderWithTry(BatchLoaderWithContex
195
214
*
196
215
* @return a new DataLoader
197
216
*
198
- * @see #newDataLoaderWithTry(BatchLoader)
217
+ * @see DataLoaderFactory#newDataLoaderWithTry(BatchLoader)
218
+ * @deprecated use {@link DataLoaderFactory} instead
199
219
*/
220
+ @ Deprecated
200
221
public static <K , V > DataLoader <K , V > newDataLoaderWithTry (BatchLoaderWithContext <K , Try <V >> batchLoadFunction , DataLoaderOptions options ) {
201
- return new DataLoader <> (batchLoadFunction , options );
222
+ return DataLoaderFactory . mkDataLoader (batchLoadFunction , options );
202
223
}
203
224
204
225
/**
@@ -210,7 +231,10 @@ public static <K, V> DataLoader<K, V> newDataLoaderWithTry(BatchLoaderWithContex
210
231
* @param <V> the value type
211
232
*
212
233
* @return a new DataLoader
234
+ *
235
+ * @deprecated use {@link DataLoaderFactory} instead
213
236
*/
237
+ @ Deprecated
214
238
public static <K , V > DataLoader <K , V > newMappedDataLoader (MappedBatchLoader <K , V > batchLoadFunction ) {
215
239
return newMappedDataLoader (batchLoadFunction , null );
216
240
}
@@ -224,9 +248,12 @@ public static <K, V> DataLoader<K, V> newMappedDataLoader(MappedBatchLoader<K, V
224
248
* @param <V> the value type
225
249
*
226
250
* @return a new DataLoader
251
+ *
252
+ * @deprecated use {@link DataLoaderFactory} instead
227
253
*/
254
+ @ Deprecated
228
255
public static <K , V > DataLoader <K , V > newMappedDataLoader (MappedBatchLoader <K , V > batchLoadFunction , DataLoaderOptions options ) {
229
- return new DataLoader <> (batchLoadFunction , options );
256
+ return DataLoaderFactory . mkDataLoader (batchLoadFunction , options );
230
257
}
231
258
232
259
/**
@@ -246,7 +273,10 @@ public static <K, V> DataLoader<K, V> newMappedDataLoader(MappedBatchLoader<K, V
246
273
* @param <V> the value type
247
274
*
248
275
* @return a new DataLoader
276
+ *
277
+ * @deprecated use {@link DataLoaderFactory} instead
249
278
*/
279
+ @ Deprecated
250
280
public static <K , V > DataLoader <K , V > newMappedDataLoaderWithTry (MappedBatchLoader <K , Try <V >> batchLoadFunction ) {
251
281
return newMappedDataLoaderWithTry (batchLoadFunction , null );
252
282
}
@@ -263,10 +293,12 @@ public static <K, V> DataLoader<K, V> newMappedDataLoaderWithTry(MappedBatchLoad
263
293
*
264
294
* @return a new DataLoader
265
295
*
266
- * @see #newDataLoaderWithTry(BatchLoader)
296
+ * @see DataLoaderFactory#newDataLoaderWithTry(BatchLoader)
297
+ * @deprecated use {@link DataLoaderFactory} instead
267
298
*/
299
+ @ Deprecated
268
300
public static <K , V > DataLoader <K , V > newMappedDataLoaderWithTry (MappedBatchLoader <K , Try <V >> batchLoadFunction , DataLoaderOptions options ) {
269
- return new DataLoader <> (batchLoadFunction , options );
301
+ return DataLoaderFactory . mkDataLoader (batchLoadFunction , options );
270
302
}
271
303
272
304
/**
@@ -278,7 +310,10 @@ public static <K, V> DataLoader<K, V> newMappedDataLoaderWithTry(MappedBatchLoad
278
310
* @param <V> the value type
279
311
*
280
312
* @return a new DataLoader
313
+ *
314
+ * @deprecated use {@link DataLoaderFactory} instead
281
315
*/
316
+ @ Deprecated
282
317
public static <K , V > DataLoader <K , V > newMappedDataLoader (MappedBatchLoaderWithContext <K , V > batchLoadFunction ) {
283
318
return newMappedDataLoader (batchLoadFunction , null );
284
319
}
@@ -292,9 +327,12 @@ public static <K, V> DataLoader<K, V> newMappedDataLoader(MappedBatchLoaderWithC
292
327
* @param <V> the value type
293
328
*
294
329
* @return a new DataLoader
330
+ *
331
+ * @deprecated use {@link DataLoaderFactory} instead
295
332
*/
333
+ @ Deprecated
296
334
public static <K , V > DataLoader <K , V > newMappedDataLoader (MappedBatchLoaderWithContext <K , V > batchLoadFunction , DataLoaderOptions options ) {
297
- return new DataLoader <> (batchLoadFunction , options );
335
+ return DataLoaderFactory . mkDataLoader (batchLoadFunction , options );
298
336
}
299
337
300
338
/**
@@ -313,7 +351,10 @@ public static <K, V> DataLoader<K, V> newMappedDataLoader(MappedBatchLoaderWithC
313
351
* @param <V> the value type
314
352
*
315
353
* @return a new DataLoader
354
+ *
355
+ * @deprecated use {@link DataLoaderFactory} instead
316
356
*/
357
+ @ Deprecated
317
358
public static <K , V > DataLoader <K , V > newMappedDataLoaderWithTry (MappedBatchLoaderWithContext <K , Try <V >> batchLoadFunction ) {
318
359
return newMappedDataLoaderWithTry (batchLoadFunction , null );
319
360
}
@@ -330,32 +371,40 @@ public static <K, V> DataLoader<K, V> newMappedDataLoaderWithTry(MappedBatchLoad
330
371
*
331
372
* @return a new DataLoader
332
373
*
333
- * @see #newDataLoaderWithTry(BatchLoader)
374
+ * @see DataLoaderFactory#newDataLoaderWithTry(BatchLoader)
375
+ * @deprecated use {@link DataLoaderFactory} instead
334
376
*/
377
+ @ Deprecated
335
378
public static <K , V > DataLoader <K , V > newMappedDataLoaderWithTry (MappedBatchLoaderWithContext <K , Try <V >> batchLoadFunction , DataLoaderOptions options ) {
336
- return new DataLoader <> (batchLoadFunction , options );
379
+ return DataLoaderFactory . mkDataLoader (batchLoadFunction , options );
337
380
}
338
381
339
382
/**
340
383
* Creates a new data loader with the provided batch load function, and default options.
341
384
*
342
385
* @param batchLoadFunction the batch load function to use
386
+ *
387
+ * @deprecated use {@link DataLoaderFactory} instead
343
388
*/
389
+ @ Deprecated
344
390
public DataLoader (BatchLoader <K , V > batchLoadFunction ) {
345
- this (batchLoadFunction , null );
391
+ this (( Object ) batchLoadFunction , null );
346
392
}
347
393
348
394
/**
349
395
* Creates a new data loader with the provided batch load function and options.
350
396
*
351
397
* @param batchLoadFunction the batch load function to use
352
398
* @param options the batch load options
399
+ *
400
+ * @deprecated use {@link DataLoaderFactory} instead
353
401
*/
402
+ @ Deprecated
354
403
public DataLoader (BatchLoader <K , V > batchLoadFunction , DataLoaderOptions options ) {
355
404
this ((Object ) batchLoadFunction , options );
356
405
}
357
406
358
- private DataLoader (Object batchLoadFunction , DataLoaderOptions options ) {
407
+ DataLoader (Object batchLoadFunction , DataLoaderOptions options ) {
359
408
DataLoaderOptions loaderOptions = options == null ? new DataLoaderOptions () : options ;
360
409
this .futureCache = determineCacheMap (loaderOptions );
361
410
// order of keys matter in data loader
0 commit comments