package com.qianwen.core.http; import java.util.function.Predicate; import javax.annotation.Nullable; /* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/RetryPolicy.class */ public class RetryPolicy { public static final RetryPolicy INSTANCE = new RetryPolicy(); private final int maxAttempts; private final long sleepMillis; @Nullable private final Predicate respPredicate; public String toString() { return "RetryPolicy(maxAttempts=" + getMaxAttempts() + ", sleepMillis=" + getSleepMillis() + ", respPredicate=" + getRespPredicate() + ")"; } public int getMaxAttempts() { return this.maxAttempts; } public long getSleepMillis() { return this.sleepMillis; } @Nullable public Predicate getRespPredicate() { return this.respPredicate; } public RetryPolicy() { this(null); } public RetryPolicy(int maxAttempts, long sleepMillis) { this(maxAttempts, sleepMillis, null); } public RetryPolicy(@Nullable Predicate respPredicate) { this(3, 0L, respPredicate); } public RetryPolicy(int maxAttempts, long sleepMillis, @Nullable Predicate respPredicate) { this.maxAttempts = maxAttempts; this.sleepMillis = sleepMillis; this.respPredicate = respPredicate; } }