Package vertxval.exp
Class IfElse<O>
- java.lang.Object
-
- vertxval.exp.IfElse<O>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IfElse<O>
alternative(Val<O> alternative)
IfElse<O>
consequence(Val<O> consequence)
Val<O>
fallbackTo(Function<Throwable,Val<O>> fn)
<Q> Val<Q>
flatMap(Function<O,Val<Q>> fn)
<U> Val<U>
flatMap(Function<O,Val<U>> successMapper, Function<Throwable,Val<U>> failureMapper)
io.vertx.core.Future<O>
get()
<P> Val<P>
map(Function<O,P> fn)
Val<O>
onComplete(io.vertx.core.Handler<io.vertx.core.AsyncResult<O>> handler)
Val<O>
onComplete(Consumer<O> successConsumer, Consumer<Throwable> failure)
Val<O>
onSuccess(Consumer<O> success)
static <O> IfElse<O>
predicate(Supplier<io.vertx.core.Future<Boolean>> predicate)
static <O> IfElse<O>
predicate(Val<Boolean> predicate)
Val<O>
recover(Function<Throwable,O> fn)
Val<O>
recoverWith(Function<Throwable,Val<O>> fn)
Val<O>
retry(int attempts)
returns a new val tha will retry its execution if it failsVal<O>
retryIf(Predicate<Throwable> predicate, int attempts)
returns a new val tha will retry its execution if it fails with an error that satisfies the given predicate
-
-
-
Method Detail
-
get
public io.vertx.core.Future<O> get()
-
retry
public Val<O> retry(int attempts)
Description copied from interface:Val
returns a new val tha will retry its execution if it fails- Parameters:
attempts
- the number of attempts before returning the error- Returns:
- a new Val
-
retryIf
public Val<O> retryIf(Predicate<Throwable> predicate, int attempts)
Description copied from interface:Val
returns a new val tha will retry its execution if it fails with an error that satisfies the given predicate- Parameters:
predicate
- the predicate against which the returned error will be tested onattempts
- the number of attempts before returning the error- Returns:
- a new Val
-
recoverWith
public Val<O> recoverWith(Function<Throwable,Val<O>> fn)
- Specified by:
recoverWith
in interfaceVal<O>
-
fallbackTo
public Val<O> fallbackTo(Function<Throwable,Val<O>> fn)
- Specified by:
fallbackTo
in interfaceVal<O>
-
onComplete
public Val<O> onComplete(Consumer<O> successConsumer, Consumer<Throwable> failure)
- Specified by:
onComplete
in interfaceVal<O>
-
flatMap
public <U> Val<U> flatMap(Function<O,Val<U>> successMapper, Function<Throwable,Val<U>> failureMapper)
-
onComplete
public Val<O> onComplete(io.vertx.core.Handler<io.vertx.core.AsyncResult<O>> handler)
- Specified by:
onComplete
in interfaceVal<O>
-
-