|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2018 the original author or authors. |
| 2 | + * Copyright 2002-2021 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
24 | 24 | *
|
25 | 25 | * <p>For example:
|
26 | 26 | * <pre class="code">
|
27 |
| - * ExchangeFunction exchangeFunction = ExchangeFunctions.create(new ReactorClientHttpConnector()); |
28 |
| - * ClientRequest request = ClientRequest.create(HttpMethod.GET, URI.create("https://example.com/resource")).build(); |
| 27 | + * ExchangeFunction exchangeFunction = |
| 28 | + * ExchangeFunctions.create(new ReactorClientHttpConnector()); |
29 | 29 | *
|
30 |
| - * Mono<String> result = exchangeFunction |
| 30 | + * URI url = URI.create("https://example.com/resource"); |
| 31 | + * ClientRequest request = ClientRequest.create(HttpMethod.GET, url).build(); |
| 32 | + * |
| 33 | + * Mono<String> bodyMono = exchangeFunction |
31 | 34 | * .exchange(request)
|
32 | 35 | * .flatMap(response -> response.bodyToMono(String.class));
|
33 | 36 | * </pre>
|
|
39 | 42 | public interface ExchangeFunction {
|
40 | 43 |
|
41 | 44 | /**
|
42 |
| - * Exchange the given request for a response mono. |
| 45 | + * Exchange the given request for a {@link ClientResponse} promise. |
43 | 46 | * @param request the request to exchange
|
44 | 47 | * @return the delayed response
|
45 | 48 | */
|
46 | 49 | Mono<ClientResponse> exchange(ClientRequest request);
|
47 | 50 |
|
48 | 51 | /**
|
49 |
| - * Filters this exchange function with the given {@code ExchangeFilterFunction}, resulting in a |
50 |
| - * filtered {@code ExchangeFunction}. |
| 52 | + * Filter the exchange function with the given {@code ExchangeFilterFunction}, |
| 53 | + * resulting in a filtered {@code ExchangeFunction}. |
51 | 54 | * @param filter the filter to apply to this exchange
|
52 | 55 | * @return the filtered exchange
|
53 | 56 | * @see ExchangeFilterFunction#apply(ExchangeFunction)
|
|
0 commit comments