/** * Wraps the given {@link Callable} in a {@link RetryerCallable}, which can * be submitted to an executor. The returned {@link RetryerCallable} uses * this {@link Retryer} instance to call the given {@link Callable}. * * @param callable the callable to wrap * @param <T> the return type of the Callable * @return a {@link RetryerCallable} that behaves like the given {@link Callable} with retry behavior defined by this {@link Retryer} */ @SuppressWarnings("WeakerAccess") public <T> RetryerCallable<T> wrap(Callable<T> callable) { return new RetryerCallable<>(this, callable); }
/** * Wraps the given {@link Callable} in a {@link RetryerCallable}, which can * be submitted to an executor. The returned {@link RetryerCallable} uses * this {@link Retryer} instance to call the given {@link Callable}. * * @param callable the callable to wrap * @return a {@link RetryerCallable} that behaves like the given {@link Callable} with retry behavior defined by this {@link Retryer} */ public RetryerCallable<V> wrap(Callable<V> callable) { return new RetryerCallable<V>(this, callable); }