33 /** |
33 /** |
34 * A {@link java.util.Map} containing the result of a HTTP/2 request and multi-response. |
34 * A {@link java.util.Map} containing the result of a HTTP/2 request and multi-response. |
35 * {@Incubating} |
35 * {@Incubating} |
36 * <p> |
36 * <p> |
37 * This is one possible implementation of the aggregate result type {@code <U>} returned |
37 * This is one possible implementation of the aggregate result type {@code <U>} returned |
38 * from {@link HttpClient#sendAsync(HttpRequest,MultiProcessor) }. |
38 * from {@link HttpClient#sendAsync(HttpRequest,HttpResponse.MultiSubscriber) }. |
39 * The map is indexed by {@link HttpRequest} and each value is a |
39 * The map is indexed by {@link HttpRequest} and each value is a |
40 * {@link java.util.concurrent.CompletableFuture}< |
40 * {@link java.util.concurrent.CompletableFuture}< |
41 * {@link HttpResponse}{@code <V>}> |
41 * {@link HttpResponse}{@code <V>}> |
42 * <p> |
42 * <p> |
43 * A {@code MultiMapResult} is obtained from an invocation such as the one shown below: |
43 * A {@code MultiMapResult} is obtained from an invocation such as the one shown below: |
44 * <p> |
44 * <p> |
45 * {@link CompletableFuture}<{@code MultiMapResult<V>}> |
45 * {@link CompletableFuture}<{@code MultiMapResult<V>}> |
46 * {@link HttpClient#sendAsync(HttpRequest, |
46 * {@link HttpClient#sendAsync(HttpRequest, |
47 * HttpResponse.MultiSubscriber) HttpClient.sendAsync(}{@link |
47 * HttpResponse.MultiSubscriber) HttpClient.sendAsync(}{@link |
48 * HttpResponse.MultiSubscriber#asMap(java.util.function.Function) |
48 * HttpResponse.MultiSubscriber#asMap(java.util.function.Function) |
49 * MultiProcessor.asMap(Function)}) |
49 * MultiSubscriber.asMap(Function)}) |
50 * |
50 * |
51 * @param <V> the response body type for all responses |
51 * @param <V> the response body type for all responses |
52 */ |
52 */ |
53 public class MultiMapResult<V> implements Map<HttpRequest,CompletableFuture<HttpResponse<V>>> { |
53 public class MultiMapResult<V> implements Map<HttpRequest,CompletableFuture<HttpResponse<V>>> { |
54 private final Map<HttpRequest,CompletableFuture<HttpResponse<V>>> map; |
54 private final Map<HttpRequest,CompletableFuture<HttpResponse<V>>> map; |