T - The value type of the resolved Promise passed as input to this callback.R - The value type of the returned Promise from this callback.@ConsumerType
public interface Success<T,R>
A Success callback is registered with a Promise using the Promise.then(Success) method and is called if the Promise is resolved successfully.
This is a functional interface and can be used as the assignment target for a lambda expression or method reference.
Promise<R> call(Promise<T> resolved) throws Exception
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 will resolve immediately with a successful value of null. If the returned Promise is not null then the chained Promise will be resolved when the returned Promise is resolved.
resolved - The successfully resolved Promise.Exception - The chained Promise will be failed with the thrown exception.Copyright © 2009-2015 The Apache Software Foundation. All Rights Reserved.