/** * Obtains the {@link Timeout} {@link Duration} in the specified {@link TimeUnit}. * * @param units the desired {@link TimeUnit} * * @return the duration measured in the specified {@link TimeUnit} */ public long to(TimeUnit units) { return duration.to(units); }
/** * Obtains the {@link MaximumRetryDelay} {@link Duration} in the specified {@link TimeUnit}. * * @param units the desired {@link TimeUnit} * * @return the duration measured in the specified {@link TimeUnit} */ public long to(TimeUnit units) { return duration.to(units); }
/** * Obtains the {@link Timeout} {@link Duration} in the specified {@link TimeUnit}. * * @param units the desired {@link TimeUnit} * * @return the duration measured in the specified {@link TimeUnit} */ public long to(TimeUnit units) { return duration.to(units); }
/** * Obtains the {@link MaximumRetryDelay} {@link Duration} in the specified {@link TimeUnit}. * * @param units the desired {@link TimeUnit} * * @return the duration measured in the specified {@link TimeUnit} */ public long to(TimeUnit units) { return duration.to(units); }
/** * Obtains the {@link InitialDelay} {@link Duration} in the specified {@link TimeUnit}. * * @param units the desired {@link TimeUnit} * * @return the duration measured in the specified {@link TimeUnit} */ public long to(TimeUnit units) { return duration.to(units); }
/** * Obtains the {@link InitialDelay} {@link Duration} in the specified {@link TimeUnit}. * * @param units the desired {@link TimeUnit} * * @return the duration measured in the specified {@link TimeUnit} */ public long to(TimeUnit units) { return duration.to(units); }
long durationMS = duration.to(TimeUnit.MILLISECONDS);
long durationMS = duration.to(TimeUnit.MILLISECONDS);
int timeoutMS = (int) timeout.getDuration().to(TimeUnit.MILLISECONDS);
long durationMS = duration.to(TimeUnit.MILLISECONDS);
long durationMS = duration.to(TimeUnit.MILLISECONDS);
/** * Obtains a randomized version of this {@link RetryFrequency}, where by * values returned from the {@link #get()} {@link Iterable} will be * randomized values between 0 and the values provided by this * {@link RetryFrequency}. * * @return a new randomized {@link RetryFrequency} */ public RetryFrequency randomized() { return new RetryFrequency(() -> new MappingIterator<>(new RandomIterator(new MappingIterator<>(this.get() .iterator(), duration -> duration.to(TimeUnit .MILLISECONDS))), duration -> Duration.of(duration, TimeUnit.MILLISECONDS))); }
/** * Obtains a randomized version of this {@link RetryFrequency}, where by * values returned from the {@link #get()} {@link Iterable} will be * randomized values between 0 and the values provided by this * {@link RetryFrequency}. * * @return a new randomized {@link RetryFrequency} */ public RetryFrequency randomized() { return new RetryFrequency(() -> new MappingIterator<>(new RandomIterator(new MappingIterator<>(this.get() .iterator(), duration -> duration.to(TimeUnit .MILLISECONDS))), duration -> Duration.of(duration, TimeUnit.MILLISECONDS))); }