Package vertxval.exp

Class IfElse<O>

  • All Implemented Interfaces:
    Supplier<io.vertx.core.Future<O>>, Val<O>

    public final class IfElse<O>
    extends Object
    • Method Detail

      • predicate

        public static <O> IfElse<O> predicate​(Val<Boolean> predicate)
      • predicate

        public static <O> IfElse<O> predicate​(Supplier<io.vertx.core.Future<Boolean>> predicate)
      • consequence

        public IfElse<O> consequence​(Val<O> consequence)
      • alternative

        public IfElse<O> alternative​(Val<O> alternative)
      • 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 on
        attempts - the number of attempts before returning the error
        Returns:
        a new Val
      • onComplete

        public Val<O> onComplete​(io.vertx.core.Handler<io.vertx.core.AsyncResult<O>> handler)
        Specified by:
        onComplete in interface Val<O>