Skip to content

Files

Latest commit

132db23 · Apr 1, 2022

History

History
This branch is 640 commits behind zalando/riptide:main.

riptide-capture

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Apr 3, 2019
Dec 16, 2019
Apr 1, 2022

Riptide: Capture

Glass of Water

Javadoc Maven Central

Riptide: Capture adds the possibility to produce meaningful return values with Riptide.

Example

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();

Features

  • produce return values based on Riptide's asynchronous API
  • type-safe

Dependencies

  • Java 8
  • Riptide: Core

Installation

Add the following dependency to your project:

<dependency>
    <groupId>org.zalando</groupId>
    <artifactId>riptide-capture</artifactId>
    <version>${riptide.version}</version>
</dependency>

Usage

Asynchronous return values

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);
}

Getting Help

If you have questions, concerns, bug reports, etc., please file an issue in this repository's Issue Tracker.

Getting Involved/Contributing

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.