Top Description Methods
org.osgi.util.promise

public Interface Success<T, R>

Annotations
@ConsumerType
@FunctionalInterface
Type Parameters
<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.
Imports
org.osgi.annotation.versioning.ConsumerType

Success callback for a Promise.

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.

Author
$Id: af80a31feedfe3d7a8e0958469ce382775b05652 $

Method Summary

Modifier and TypeMethod and Description
public Promise<R>

Returns:

The Promise to use to resolve the chained Promise, or null if the chained Promise is to be resolved immediately with the value null.
call
(Promise<T>
The successfully resolved Promise.
resolved
)

Success callback for a Promise.

Method Detail

callback to summary
public Promise<R> call(Promise<T> resolved) throws Exception

Success callback for a Promise.

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.

Parameters
resolved:Promise<T>

The successfully resolved Promise.

Returns:Promise<R>

The Promise to use to resolve the chained Promise, or null if the chained Promise is to be resolved immediately with the value null.

Exceptions
Exception:
The chained Promise must be failed with the thrown exception.