Package org.apache.hc.core5.concurrent
Class CompletingFutureContribution<T,U>
- java.lang.Object
-
- org.apache.hc.core5.concurrent.FutureContribution<T>
-
- org.apache.hc.core5.concurrent.CompletingFutureContribution<T,U>
-
- Type Parameters:
T- the future result type of an asynchronous operation for this type.U- the future result type of an asynchronous operation for theFutureCallback.
- All Implemented Interfaces:
FutureCallback<T>
public class CompletingFutureContribution<T,U> extends FutureContribution<T>
Completes a result on aBasicFuture.- Since:
- 5.4
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.Function<T,U>resultProvider
-
Constructor Summary
Constructors Constructor Description CompletingFutureContribution(BasicFuture<U> future)Constructs a new instance to callback the givenBasicFuture.CompletingFutureContribution(BasicFuture<U> future, java.util.function.Function<T,U> resultProvider)Constructs a new instance to callback the givenBasicFuture.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcompleted(T result)-
Methods inherited from class org.apache.hc.core5.concurrent.FutureContribution
cancelled, failed, getFuture
-
-
-
-
Constructor Detail
-
CompletingFutureContribution
public CompletingFutureContribution(BasicFuture<U> future)
Constructs a new instance to callback the givenBasicFuture.- Parameters:
future- The callback.
-
CompletingFutureContribution
public CompletingFutureContribution(BasicFuture<U> future, java.util.function.Function<T,U> resultProvider)
Constructs a new instance to callback the givenBasicFuture.- Parameters:
future- The callback.resultProvider- Provides the result to complete the future.
-
-
Method Detail
-
completed
public void completed(T result)
-
-