- java.lang.Object
-
- vertxval.core.AbstractVal<O>
-
-
Constructor Summary
Constructors Constructor Description AbstractVal()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Val<O>
fallbackTo(λ<Throwable,O> fn)
<Q> Val<Q>
flatMap(λ<O,Q> fn)
Creates a new value by applying a function to the successful result of this value, and returns the result of the function as the new value.<U> Val<U>
flatMap(λ<O,U> successMapper, λ<Throwable,U> failureMapper)
Val<O>
onComplete(io.vertx.core.Handler<io.vertx.core.AsyncResult<O>> handler)
Add a handler to be notified of the result.Val<O>
onComplete(Consumer<O> successConsumer, Consumer<Throwable> failureConsumer)
Add a handler to be notified of the result.Val<O>
onSuccess(Consumer<O> success)
Adds a consumer to be notified of the succeeded result of this value.Val<O>
recover(Function<Throwable,O> fn)
Creates a new value that will handle any matching throwable that this value might contain.Val<O>
recoverWith(λ<Throwable,O> fn)
Creates a new value that will handle any matching throwable that this value might contain by assigning it another value.
-
-
-
Method Detail
-
recover
public Val<O> recover(Function<Throwable,O> fn)
Description copied from interface:Val
Creates a new value that will handle any matching throwable that this value might contain. If there is no match, or if this future contains a valid result then the new future will contain the same.
-
recoverWith
public Val<O> recoverWith(λ<Throwable,O> fn)
Description copied from interface:Val
Creates a new value that will handle any matching throwable that this value might contain by assigning it another value.- Specified by:
recoverWith
in interfaceVal<O>
- Parameters:
fn
- the function to apply if this Future fails- Returns:
- a new value
-
fallbackTo
public Val<O> fallbackTo(λ<Throwable,O> fn)
- Specified by:
fallbackTo
in interfaceVal<O>
-
flatMap
public <Q> Val<Q> flatMap(λ<O,Q> fn)
Description copied from interface:Val
Creates a new value by applying a function to the successful result of this value, and returns the result of the function as the new value. If this value returns an exception then the new value will also contain this exception.
-
onSuccess
public Val<O> onSuccess(Consumer<O> success)
Description copied from interface:Val
Adds a consumer to be notified of the succeeded result of this value.
-
onComplete
public Val<O> onComplete(Consumer<O> successConsumer, Consumer<Throwable> failureConsumer)
Description copied from interface:Val
Add a handler to be notified of the result.- Specified by:
onComplete
in interfaceVal<O>
- Parameters:
successConsumer
- the handler that will be called with the succeeded resultfailureConsumer
- the handler that will be called with the failed result- Returns:
- a reference to this, so it can be used fluently
-
onComplete
public Val<O> onComplete(io.vertx.core.Handler<io.vertx.core.AsyncResult<O>> handler)
Description copied from interface:Val
Add a handler to be notified of the result.- Specified by:
onComplete
in interfaceVal<O>
- Parameters:
handler
- the handler that will be called with the result- Returns:
- a reference to this, so it can be used fluently
-
-