Invoked if the computation completes successfully.
Invoked if the computation completes successfully. Returns the new transformed value in a Future.
Invoked if the computation fails.
Invoked if the computation fails. Returns the new transformed value.
Invoked if the computation completes successfully.
Invoked if the computation completes successfully. Returns the new transformed value.
Note: this method will throw an AbstractMethodError
if it is not overridden.
Invoked if the computation completes unsuccessfully.
Invoked if the computation completes unsuccessfully. Returns the new Future value.
An alternative interface for performing Future transformations; that is, converting a Future[A] to a Future[B]. This interface is designed to be friendly to Java users since it does not require creating many small Function objects. It is used in conjunction with
transformedBy
.You must override one of
{map, flatMap}
. If you override bothmap
andflatMap
,flatMap
takes precedence. If you fail to override one of{map, flatMap}
, anAbstractMethodError
will be thrown at Runtime.Note: to end a result with a failure, we encourage you to use either
flatMap
orrescue
and return a failed Future, instead of throwing an exception. A failed future can be used by returningFuture.exception(throwable)
instead of throwing an exception.FutureEventListener for a Java API for side-effects.
Future.transformedBy for using it with a
Future
.Future.transform which is the equivalent Scala API for further details.