Sets the max duration to perform retries for, else the execution will be failed.

@throws NullPointerException if {@code maxDuration} is null
@throws IllegalStateException if {@code maxDuration} is <= the {@link RetryPolicy#withDelay(Duration) delay}
433043
public RetryPolicy<R> withMaxDuration(Duration maxDuration) {
    Assert.notNull(maxDuration, "maxDuration");
    Assert.state(maxDuration.toNanos() > delay.toNanos(), "maxDuration must be greater than the delay");
    this.maxDuration = maxDuration;
    return this;
  }
855396
public void setMax(int max)
    {
        this.max = max;
        if (this.max < Alterable.MIN)
        {
            this.max = Alterable.MIN;
        }
        set(cur);
    }
504253
public void setExpirationTime(long expirationTime) {
	  if (lock == SET) {
		 throw new IllegalStateException("EntryInfo is locked");
	  }
	  expirationTimeFlag = SET;
	  this.expirationTime = expirationTime;
	  this.timeLimit = (int) ((expirationTime - System.currentTimeMillis()) / 1000L);
   }
176945
public MultiPrimaryProtocolBuilder withRetryDelay(long retryDelay, TimeUnit timeUnit) {
    return withRetryDelay(Duration.ofMillis(timeUnit.toMillis(retryDelay)));
  }
1294908
public void setMaxValue(final double VALUE) {
        if (Status.RUNNING == timeline.getStatus()) { timeline.jumpTo(Duration.ONE); }
        if (null == maxValue) {
            if (VALUE < getMinValue()) { setMinValue(VALUE); }
            _maxValue = clamp(getMinValue(), Double.MAX_VALUE, VALUE);
            setRange(_maxValue - getMinValue());
            if (Helper.equals(originalMaxValue, Double.MAX_VALUE)) originalMaxValue = _maxValue;
            if (Helper.biggerThan(originalThreshold, getThreshold())) { setThreshold(clamp(getMinValue(), _maxValue, originalThreshold)); }
            fireTileEvent(RECALC_EVENT);
            if (!valueProperty().isBound()) Tile.this.setValue(clamp(getMinValue(), getMaxValue(), Tile.this.getValue()));
        } else {
            maxValue.set(VALUE);
        }
    }
375134
public RetryInterceptorBuilder<T> retryPolicy(RetryPolicy policy) {
		Assert.isNull(this.retryOperations,
				"cannot set the retry policy when a custom retryOperations has been set");
		Assert.isTrue(!this.templateAltered,
				"cannot set the retry policy if max attempts or back off policy or options changed");
		this.retryTemplate.setRetryPolicy(policy);
		this.retryPolicySet = true;
		this.templateAltered = true;
		return this;
	}
295174
public void setMax(java.lang.Object _max) {
		getStateHelper().put(PropertyKeys.max, _max);
	}
882916
public void setMinimumDuration(@NotNull final Duration minimumDuration) {
        if (minimumDuration.compareTo(MAXIMUM_DURATION) > 0) {
            throw new IllegalArgumentException("The minimum duaration has to be smaller than 23:59:59.");
        }
        this.minimumDuration = durationToDate(minimumDuration);
    }
254181
public void setNested() {
        // If using fallback or retry, stop the timeout and restart in synchronous mode
        if (timeout != null && (retry.getMaxRetries() != 0 || fallbackPolicy != null)) {
            timeout.runSyncOnNewThread(Thread.currentThread());
        }

        int retriesRemaining = this.retry.getMaxRetries() - this.retries;
        if (this.retry.getMaxDuration() != null) {
            long maxDuration = this.retry.getMaxDuration().toNanos();
            long now = System.nanoTime();
            long elapsed = now - this.startTime;

            long delay = this.retry.getDelay().toNanos();
            maxDuration = maxDuration - elapsed;

            if (maxDuration <= delay) {
                maxDuration = delay + 1;
                retriesRemaining = 0;
            }
            this.retry.withMaxDuration(maxDuration, TimeUnit.NANOSECONDS);
        }
        this.retry.withMaxRetries(retriesRemaining);
    }
1345469
public RetryerBuilder<V> withAttemptTimeLimiter(@Nonnull AttemptTimeLimiter<V> attemptTimeLimiter) {
        Preconditions.checkNotNull(attemptTimeLimiter);
        this.attemptTimeLimiter = attemptTimeLimiter;
        return this;
    }
448144
public void setAcquireRetryDelay(long acquireRetryDelay, TimeUnit timeUnit) {
		this.acquireRetryDelayInMs = TimeUnit.MILLISECONDS.convert(acquireRetryDelay, timeUnit);
	}
459113
public HttpHealthCheckedEndpointGroupBuilder retryInterval(Duration retryInterval) {
        requireNonNull(retryInterval, "retryInterval");
        checkArgument(!retryInterval.isNegative() && !retryInterval.isZero(),
                      "retryInterval: %s (expected > 0)", retryInterval);
        this.retryInterval = retryInterval;
        return this;
    }
1338490
@Override
	public boolean canRetry(RetryContext context) {
		Throwable t = context.getLastThrowable();
		return (t == null || retryForException(t))
				&& context.getRetryCount() < this.maxAttempts;
	}
684752
@Override
  public DurationFormatterFactory setFallback(DateFormatter fallback) {
    boolean doReset = fallback == null
        ? this.fallback != null
        : !fallback.equals(this.fallback);
    if (doReset) {
      this.fallback = fallback;
      reset();
    }
    return this;
  }
956628
@Nonnull
  public CacheControlBuilder setMaxAge (@Nonnull final TimeUnit eTimeUnit, final long nDuration)
  {
    return setMaxAgeSeconds (eTimeUnit.toSeconds (nDuration));
  }
1362676
public static void setHoverDelay(Duration duration) {
        BEHAVIOR.setHoverDelay(duration == null ? Duration.millis(650) : duration);
    }
1364244
public void setDuration(int index, Duration value)
   {
      set(selectField(ResourceFieldLists.CUSTOM_DURATION, index), value);
   }