@Test public void map() { Future<String> future = Future.success("Hello world!"); Future<String> result = future.map(String::toUpperCase); assertEquals(Try.success("HELLO WORLD!"), result.await()); }
@Override public <R> Future<R> map(Function1<? super T, ? extends R> mapper) { return transform(value -> value.map(mapper)); }
FutureImpl implements SealedFuture<T> { @Override public <R> Future<R> map(Function1<? super T, ? extends R> mapper) { return transform(value -> value.map(mapper)); } }
FutureImpl implements SealedFuture<T> { @Override public <R> Future<R> map(Function1<? super T, ? extends R> mapper) { return transform(value -> value.map(mapper)); } private  FutureImpl(Executor executor, Callback<T> callback); private  FutureImpl(Executor executor, Callback<T> callback, Propagate propagate); }
FutureImpl implements SealedFuture<T> { @Override public <R> Future<R> map(Function1<? super T, ? extends R> mapper) { return transform(value -> value.map(mapper)); } private  FutureImpl(Executor executor, Callback<T> callback); private  FutureImpl(Executor executor, Callback<T> callback, Propagate propagate); @Override Future<T> onComplete(Consumer1<? super Try<? extends T>> consumer); @Override Future<T> onSuccess(Consumer1<? super T> consumer); @Override Future<T> onFailure(Consumer1<? super Throwable> consumer); @Override boolean isCompleted(); @Override boolean isCancelled(); @Override Try<T> await(); @Override Try<T> await(Duration timeout); @Override Future<R> map(Function1<? super T, ? extends R> mapper); @Override Future<R> flatMap(Function1<? super T, ? extends Future<? extends R>> mapper); @Override Future<R> andThen(Future<? extends R> next); @Override Future<R> ap(Future<Function1<? super T, ? extends R>> apply); @Override Future<T> filter(Matcher1<? super T> matcher); @Override Future<T> orElse(Future<? extends T> other); @Override Future<T> recoverWith(Class<X> type, Function1<? super X, ? extends T> mapper); @Override Future<U> fold(Function1<? super Throwable, ? extends U> failureMapper, Function1<? super T, ? extends U> successMapper); @Override void cancel(boolean mayInterruptThread); @Override Promise<T> toPromise(); }
FutureImpl implements SealedFuture<T> { @Override public <R> Future<R> map(Function1<? super T, ? extends R> mapper) { return transform(value -> value.map(mapper)); } private  FutureImpl(Executor executor, Callback<T> callback); private  FutureImpl(Executor executor, Callback<T> callback, Propagate propagate); @Override Future<T> onComplete(Consumer1<? super Try<? extends T>> consumer); @Override Future<T> onSuccess(Consumer1<? super T> consumer); @Override Future<T> onFailure(Consumer1<? super Throwable> consumer); @Override boolean isCompleted(); @Override boolean isCancelled(); @Override Try<T> await(); @Override Try<T> await(Duration timeout); @Override Future<R> map(Function1<? super T, ? extends R> mapper); @Override Future<R> flatMap(Function1<? super T, ? extends Future<? extends R>> mapper); @Override Future<R> andThen(Future<? extends R> next); @Override Future<R> ap(Future<Function1<? super T, ? extends R>> apply); @Override Future<T> filter(Matcher1<? super T> matcher); @Override Future<T> orElse(Future<? extends T> other); @Override Future<T> recoverWith(Class<X> type, Function1<? super X, ? extends T> mapper); @Override Future<U> fold(Function1<? super Throwable, ? extends U> failureMapper, Function1<? super T, ? extends U> successMapper); @Override void cancel(boolean mayInterruptThread); @Override Promise<T> toPromise();  }