private static final class PromiseImpl.Map<T,R> extends java.lang.Object implements Success<T,R>
PromiseImpl.map(Function)
method.Modifier and Type | Field and Description |
---|---|
private Function<? super T,? extends R> |
mapper |
Constructor and Description |
---|
Map(Function<? super T,? extends R> mapper) |
Modifier and Type | Method and Description |
---|---|
Promise<R> |
call(Promise<T> resolved)
Success callback for a Promise.
|
public Promise<R> call(Promise<T> resolved) throws java.lang.Exception
Success
This method is called if the Promise with which it is registered resolves successfully.
In the remainder of this description we will refer to the Promise
returned by this method as the returned Promise and the Promise returned
by Promise.then(Success)
when this Success callback was
registered as the chained Promise.
If the returned Promise is null
then the chained Promise must
resolve immediately with a successful value of null
. If the
returned Promise is not null
then the chained Promise must be
resolved when the returned Promise is resolved.
call
in interface Success<T,R>
resolved
- The successfully resolved Promise
.null
if the chained Promise is to be resolved immediately
with the value null
.java.lang.Exception
- The chained Promise must be failed with the thrown
exception.