com.commercetools.http.apachehttp.CompletableFutureCallbackAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commercetools-apachehttp-client Show documentation
Show all versions of commercetools-apachehttp-client Show documentation
The e-commerce SDK from commercetools Composable Commerce for Java
The newest version!
package com.commercetools.http.apachehttp;
import java.util.concurrent.CompletableFuture;
import org.apache.hc.core5.concurrent.FutureCallback;
final class CompletableFutureCallbackAdapter implements FutureCallback {
private final CompletableFuture future;
public CompletableFutureCallbackAdapter(final CompletableFuture future) {
this.future = future;
}
@Override
public void cancelled() {
future.cancel(true);
}
@Override
public void completed(final T result) {
future.complete(result);
}
@Override
public void failed(final Exception e) {
future.completeExceptionally(e);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy