Skip to content

Commit

Permalink
Adds convenient overloaded constructor for Request.Options
Browse files Browse the repository at this point in the history
  • Loading branch information
miwanczuk committed Jun 20, 2023
1 parent bde91be commit 0776122
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/src/main/java/feign/Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.io.Serializable;
import java.net.HttpURLConnection;
import java.nio.charset.Charset;
import java.time.Duration;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -349,6 +350,18 @@ public Options(int connectTimeoutMillis, int readTimeoutMillis) {
this(connectTimeoutMillis, readTimeoutMillis, true);
}

/**
* Creates a new Options Instance.
*
* @param connectTimeout value.
* @param readTimeout value.
* @param followRedirects if the request should follow 3xx redirections.
*/
public Options(Duration connectTimeout, Duration readTimeout, boolean followRedirects) {
this(connectTimeout.toMillis(), TimeUnit.MILLISECONDS, readTimeout.toMillis(),
TimeUnit.MILLISECONDS, followRedirects);
}

/**
* Creates the new Options instance using the following defaults:
* <ul>
Expand Down

0 comments on commit 0776122

Please sign in to comment.