Class Futures.AugmentedFuture<A>
java.lang.Object
scala.AnyVal
com.here.platform.data.client.utils.Futures.AugmentedFuture<A>
- Enclosing class:
- Futures
public static final class Futures.AugmentedFuture<A>
extends scala.AnyVal
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionscala.concurrent.Future<A>augmentedHandleFailure(scala.Function1<Throwable, scala.runtime.BoxedUnit> action, scala.concurrent.ExecutionContext executor) Causes an asynchronous side effect in case the future fails.<B> scala.concurrent.Future<B>augmentedMapTry(scala.Function1<scala.util.Try<A>, B> f, scala.concurrent.ExecutionContext executor) Map over the innerTry[A]completion value of the future, rather than theAsuccess value like the normalscala.concurrent.Future.mapmethod.scala.concurrent.Future<scala.Option<A>>augmentedToOption(scala.concurrent.ExecutionContext executor) Converts the "inner Try" of the Future to an option, wrapping successful values in Some and replacing failures with None.<B> scala.concurrent.Future<B>augmentedTransformWith(scala.Function1<scala.util.Try<A>, scala.concurrent.Future<B>> f, scala.concurrent.ExecutionContext executor) Flat-map over the innerTry[A]completion value of the future, rather than theAsuccess value like the normalscala.concurrent.Future.flatMapmethod.scala.concurrent.Future<A>self()
-
Constructor Details
-
AugmentedFuture
-
-
Method Details
-
self
-
augmentedMapTry
public <B> scala.concurrent.Future<B> augmentedMapTry(scala.Function1<scala.util.Try<A>, B> f, scala.concurrent.ExecutionContext executor) Map over the innerTry[A]completion value of the future, rather than theAsuccess value like the normalscala.concurrent.Future.mapmethod. -
augmentedTransformWith
public <B> scala.concurrent.Future<B> augmentedTransformWith(scala.Function1<scala.util.Try<A>, scala.concurrent.Future<B>> f, scala.concurrent.ExecutionContext executor) Flat-map over the innerTry[A]completion value of the future, rather than theAsuccess value like the normalscala.concurrent.Future.flatMapmethod.Note that this method is provided by
Futurestarting in Scala 2.12. -
augmentedToOption
public scala.concurrent.Future<scala.Option<A>> augmentedToOption(scala.concurrent.ExecutionContext executor) Converts the "inner Try" of the Future to an option, wrapping successful values in Some and replacing failures with None.This is useful if the result will just not be used in the case of an error.
-
augmentedHandleFailure
public scala.concurrent.Future<A> augmentedHandleFailure(scala.Function1<Throwable, scala.runtime.BoxedUnit> action, scala.concurrent.ExecutionContext executor) Causes an asynchronous side effect in case the future fails.Note that the original future is returned, meaning that it will be completed before the action has completed.
-