- java.lang.Object
-
- vertxval.core.AbstractVal<O>
-
- vertxval.exp.Cond<O>
-
public final class Cond<O> extends AbstractVal<O>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.vertx.core.Future<O>
get()
<P> Val<P>
map(Function<O,P> fn)
Creates a new value by applying a function to the successful result of this value.static <O> Cond<O>
of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2)
static <O> Cond<O>
of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<Boolean> test3, Val<O> consequent3)
static <O> Cond<O>
of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<Boolean> test3, Val<O> consequent3, Val<Boolean> test4, Val<O> consequent4)
static <O> Cond<O>
of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<Boolean> test3, Val<O> consequent3, Val<Boolean> test4, Val<O> consequent4, Val<Boolean> test5, Val<O> consequent5)
static <O> Cond<O>
of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<Boolean> test3, Val<O> consequent3, Val<Boolean> test4, Val<O> consequent4, Val<Boolean> test5, Val<O> consequent5, Val<Boolean> test6, Val<O> consequent6)
static <O> Cond<O>
of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<Boolean> test3, Val<O> consequent3, Val<Boolean> test4, Val<O> consequent4, Val<Boolean> test5, Val<O> consequent5, Val<Boolean> test6, Val<O> consequent6, Val<O> otherwise)
static <O> Cond<O>
of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<Boolean> test3, Val<O> consequent3, Val<Boolean> test4, Val<O> consequent4, Val<Boolean> test5, Val<O> consequent5, Val<O> otherwise)
static <O> Cond<O>
of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<Boolean> test3, Val<O> consequent3, Val<Boolean> test4, Val<O> consequent4, Val<O> otherwise)
static <O> Cond<O>
of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<Boolean> test3, Val<O> consequent3, Val<O> otherwise)
static <O> Cond<O>
of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<O> otherwise)
Val<O>
retry(int attempts)
returns a new value tha will retry its execution if it failsVal<O>
retry(int attempts, BiFunction<Throwable,Integer,Val<Void>> actionBeforeRetry)
returns a new value tha will retry its execution after the an action.Val<O>
retryIf(Predicate<Throwable> predicate, int attempts)
returns a new value tha will retry its execution if it fails with an error that satisfies the given predicate.Val<O>
retryIf(Predicate<Throwable> predicate, int attempts, BiFunction<Throwable,Integer,Val<Void>> actionBeforeRetry)
returns a new value tha will retry its execution after an action if it fails with an error that satisfies the given predicate.-
Methods inherited from class vertxval.core.AbstractVal
fallbackTo, flatMap, flatMap, onComplete, onComplete, onSuccess, recover, recoverWith
-
-
-
-
Method Detail
-
of
public static <O> Cond<O> of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<O> otherwise)
-
of
public static <O> Cond<O> of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2)
-
of
public static <O> Cond<O> of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<Boolean> test3, Val<O> consequent3, Val<O> otherwise)
-
of
public static <O> Cond<O> of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<Boolean> test3, Val<O> consequent3)
-
of
public static <O> Cond<O> of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<Boolean> test3, Val<O> consequent3, Val<Boolean> test4, Val<O> consequent4, Val<O> otherwise)
-
of
public static <O> Cond<O> of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<Boolean> test3, Val<O> consequent3, Val<Boolean> test4, Val<O> consequent4)
-
of
public static <O> Cond<O> of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<Boolean> test3, Val<O> consequent3, Val<Boolean> test4, Val<O> consequent4, Val<Boolean> test5, Val<O> consequent5, Val<O> otherwise)
-
of
public static <O> Cond<O> of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<Boolean> test3, Val<O> consequent3, Val<Boolean> test4, Val<O> consequent4, Val<Boolean> test5, Val<O> consequent5)
-
of
public static <O> Cond<O> of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<Boolean> test3, Val<O> consequent3, Val<Boolean> test4, Val<O> consequent4, Val<Boolean> test5, Val<O> consequent5, Val<Boolean> test6, Val<O> consequent6, Val<O> otherwise)
-
of
public static <O> Cond<O> of(Val<Boolean> test1, Val<O> consequent1, Val<Boolean> test2, Val<O> consequent2, Val<Boolean> test3, Val<O> consequent3, Val<Boolean> test4, Val<O> consequent4, Val<Boolean> test5, Val<O> consequent5, Val<Boolean> test6, Val<O> consequent6)
-
map
public <P> Val<P> map(Function<O,P> fn)
Description copied from interface:Val
Creates a new value by applying a function to the successful result of this value. If this value returns an exception then the new value will also contain this exception.- Type Parameters:
P
- the type of the returned value- Parameters:
fn
- the function which will be applied to the successful result of this value- Returns:
- a new value
-
retry
public Val<O> retry(int attempts)
Description copied from interface:Val
returns a new value tha will retry its execution if it fails- Parameters:
attempts
- the number of attempts before returning an error- Returns:
- a new value
-
retry
public Val<O> retry(int attempts, BiFunction<Throwable,Integer,Val<Void>> actionBeforeRetry)
Description copied from interface:Val
returns a new value tha will retry its execution after the an action.- Parameters:
attempts
- the number of attempts before returning an erroractionBeforeRetry
- the function that produces the action to be executed before the retry- Returns:
- a new value
-
retryIf
public Val<O> retryIf(Predicate<Throwable> predicate, int attempts)
Description copied from interface:Val
returns a new value 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 an error- Returns:
- a new value
-
retryIf
public Val<O> retryIf(Predicate<Throwable> predicate, int attempts, BiFunction<Throwable,Integer,Val<Void>> actionBeforeRetry)
Description copied from interface:Val
returns a new value tha will retry its execution after an action 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 an erroractionBeforeRetry
- the function that produces the action to be executed before the retry- Returns:
- a new value
-
get
public io.vertx.core.Future<O> get()
-
-