AsyncResult

Encapsulates the result of an asynchronous operation. <p> Many operations in Vert.x APIs provide results back by passing an instance of this in a {@link hunt.net.Handler}. <p> The result can either have failed or succeeded. <p> If it failed then the cause of the failure is available with {@link #cause}. <p> If it succeeded then the actual result is available with {@link #result}

@author <a href="http://tfox.org">Tim Fox</a>

Members

Functions

map
AsyncResult!(U) map(Function!(T, U) mapper)

Apply a {@code mapper} function on this async result.<p>

map
AsyncResult!(V) map(V value)

Map the result of this async result to a specific {@code value}.<p>

mapEmpty
AsyncResult!(V) mapEmpty()

Map the result of this async result to {@code null}.<p>

otherwise
AsyncResult!(T) otherwise(Function!(Throwable, T) mapper)

Apply a {@code mapper} function on this async result.<p>

otherwise
AsyncResult!(T) otherwise(T value)

Map the failure of this async result to a specific {@code value}.<p>

otherwiseEmpty
AsyncResult!(T) otherwiseEmpty()

Map the failure of this async result to {@code null}.<p>

result
T result()

The result of the operation. This will be null if the operation failed.

Inherited Members

From IAsyncResult

cause
Throwable cause()

A Throwable describing failure. This will be null if the operation succeeded.

succeeded
bool succeeded()

Did it succeed?

failed
bool failed()

Did it fail?

Meta