Module vertx.values
Package vertxval.exp

Class Cond<O>

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

    public final class Cond<O>
    extends AbstractVal<O>
    • Method Detail

      • 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 error
        actionBeforeRetry - 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 on
        attempts - 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 on
        attempts - the number of attempts before returning an error
        actionBeforeRetry - the function that produces the action to be executed before the retry
        Returns:
        a new value
      • get

        public io.vertx.core.Future<O> get()