Riptide: Capture adds the possibility to produce meaningful return values with Riptide.
Capture<Order> capture = Capture.empty();
Order order = http.get("/sales-orders/{id}", id)
.dispatch(series(),
on(SUCCESSFUL).dispatch(contentType(),
on(MediaTypes.ORDER).call(Order.class, capture)))
.thenApply(capture).join();
- produce return values based on Riptide's asynchronous API
- type-safe
- Riptide: Core
Add the following dependency to your project:
<dependency>
<groupId>org.zalando</groupId>
<artifactId>riptide-capture</artifactId>
<version>${riptide.version}</version>
</dependency>
public CompletableFuture<Order> getOrder(final String id) {
Capture<Order> capture = Capture.empty();
return http.get("/sales-orders/{id}", id)
.dispatch(series(),
on(SUCCESSFUL).dispatch(contentType(),
on(MediaTypes.ORDER).call(Order.class, capture)))
.thenApply(capture);
}
If you have questions, concerns, bug reports, etc., please file an issue in this repository's Issue Tracker.
To contribute, simply make a pull request and add a brief description (1-2 sentences) of your addition or change. For more details, check the contribution guidelines.