-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathDispatchResult.java
More file actions
33 lines (27 loc) · 929 Bytes
/
DispatchResult.java
File metadata and controls
33 lines (27 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package org.dataloader;
import org.dataloader.annotations.PublicApi;
import org.jspecify.annotations.NullMarked;
import java.util.List;
import java.util.concurrent.CompletableFuture;
/**
* When a DataLoader is dispatched this object holds the promised results and also the count of key asked for
* via methods like {@link org.dataloader.DataLoader#load(Object)} or {@link org.dataloader.DataLoader#loadMany(java.util.List)}
*
* @param <T> for two
*/
@PublicApi
@NullMarked
public class DispatchResult<T> {
private final CompletableFuture<List<T>> futureList;
private final int keysCount;
public DispatchResult(CompletableFuture<List<T>> futureList, int keysCount) {
this.futureList = futureList;
this.keysCount = keysCount;
}
public CompletableFuture<List<T>> getPromisedResults() {
return futureList;
}
public int getKeysCount() {
return keysCount;
}
}