|
57 | 57 | */
|
58 | 58 | public class DataLoader<K, V> {
|
59 | 59 |
|
60 |
| - private final DataLoaderHelper<K,V> helper; |
| 60 | + private final DataLoaderHelper<K, V> helper; |
61 | 61 | private final DataLoaderOptions loaderOptions;
|
62 | 62 | private final CacheMap<Object, CompletableFuture<V>> futureCache;
|
63 | 63 | private final List<SimpleImmutableEntry<K, CompletableFuture<V>>> loaderQueue;
|
@@ -96,10 +96,12 @@ public static <K, V> DataLoader<K, V> newDataLoader(BatchLoader<K, V> batchLoadF
|
96 | 96 | * (batching, caching and unlimited batch size) where the batch loader function returns a list of
|
97 | 97 | * {@link org.dataloader.Try} objects.
|
98 | 98 | *
|
99 |
| - * This allows you to capture both the value that might be returned and also whether exception that might have occurred getting that individual value. If its important you to |
100 |
| - * know the exact status of each item in a batch call and whether it threw exceptions when fetched then |
| 99 | + * If its important you to know the exact status of each item in a batch call and whether it threw exceptions then |
101 | 100 | * you can use this form to create the data loader.
|
102 | 101 | *
|
| 102 | + * Using Try objects allows you to capture a value returned or an exception that might |
| 103 | + * have occurred trying to get a value. . |
| 104 | + * |
103 | 105 | * @param batchLoadFunction the batch load function to use that uses {@link org.dataloader.Try} objects
|
104 | 106 | * @param <K> the key type
|
105 | 107 | * @param <V> the value type
|
@@ -162,10 +164,12 @@ public static <K, V> DataLoader<K, V> newDataLoader(BatchLoaderWithContext<K, V>
|
162 | 164 | * (batching, caching and unlimited batch size) where the batch loader function returns a list of
|
163 | 165 | * {@link org.dataloader.Try} objects.
|
164 | 166 | *
|
165 |
| - * This allows you to capture both the value that might be returned and also whether exception that might have occurred getting that individual value. If its important you to |
166 |
| - * know the exact status of each item in a batch call and whether it threw exceptions when fetched then |
| 167 | + * If its important you to know the exact status of each item in a batch call and whether it threw exceptions then |
167 | 168 | * you can use this form to create the data loader.
|
168 | 169 | *
|
| 170 | + * Using Try objects allows you to capture a value returned or an exception that might |
| 171 | + * have occurred trying to get a value. . |
| 172 | + * |
169 | 173 | * @param batchLoadFunction the batch load function to use that uses {@link org.dataloader.Try} objects
|
170 | 174 | * @param <K> the key type
|
171 | 175 | * @param <V> the value type
|
@@ -227,10 +231,12 @@ public static <K, V> DataLoader<K, V> newMappedDataLoader(MappedBatchLoader<K, V
|
227 | 231 | * (batching, caching and unlimited batch size) where the batch loader function returns a list of
|
228 | 232 | * {@link org.dataloader.Try} objects.
|
229 | 233 | *
|
230 |
| - * This allows you to capture both the value that might be returned and also whether exception that might have occurred getting that individual value. If its important you to |
231 |
| - * know the exact status of each item in a batch call and whether it threw exceptions when fetched then |
| 234 | + * If its important you to know the exact status of each item in a batch call and whether it threw exceptions then |
232 | 235 | * you can use this form to create the data loader.
|
233 | 236 | *
|
| 237 | + * Using Try objects allows you to capture a value returned or an exception that might |
| 238 | + * have occurred trying to get a value. . |
| 239 | + * |
234 | 240 | * @param batchLoadFunction the batch load function to use that uses {@link org.dataloader.Try} objects
|
235 | 241 | * @param <K> the key type
|
236 | 242 | * @param <V> the value type
|
@@ -293,10 +299,12 @@ public static <K, V> DataLoader<K, V> newMappedDataLoader(MappedBatchLoaderWithC
|
293 | 299 | * (batching, caching and unlimited batch size) where the batch loader function returns a list of
|
294 | 300 | * {@link org.dataloader.Try} objects.
|
295 | 301 | *
|
296 |
| - * This allows you to capture both the value that might be returned and also whether exception that might have occurred getting that individual value. If its important you to |
297 |
| - * know the exact status of each item in a batch call and whether it threw exceptions when fetched then |
| 302 | + * If its important you to know the exact status of each item in a batch call and whether it threw exceptions then |
298 | 303 | * you can use this form to create the data loader.
|
299 | 304 | *
|
| 305 | + * Using Try objects allows you to capture a value returned or an exception that might |
| 306 | + * have occurred trying to get a value. . |
| 307 | + * |
300 | 308 | * @param batchLoadFunction the batch load function to use that uses {@link org.dataloader.Try} objects
|
301 | 309 | * @param <K> the key type
|
302 | 310 | * @param <V> the value type
|
@@ -352,7 +360,7 @@ private DataLoader(Object batchLoadFunction, DataLoaderOptions options) {
|
352 | 360 | this.loaderQueue = new ArrayList<>();
|
353 | 361 | this.stats = nonNull(this.loaderOptions.getStatisticsCollector());
|
354 | 362 |
|
355 |
| - this.helper = new DataLoaderHelper<>(this, batchLoadFunction,this.loaderOptions, futureCache, loaderQueue, stats); |
| 363 | + this.helper = new DataLoaderHelper<>(this, batchLoadFunction, this.loaderOptions, futureCache, loaderQueue, stats); |
356 | 364 | }
|
357 | 365 |
|
358 | 366 | @SuppressWarnings("unchecked")
|
|
0 commit comments