-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #10: Prepare snapshot 0.8.0.BETA-JDK11-SNAPSHOT for JDK 11 build * #10: Prepare snapshot 0.8.0.BETA-JDK11-SNAPSHOT for JDK 11 build * #10: Prepare snapshot 0.8.0.BETA-JDK11-SNAPSHOT for JDK 11 build * #10: Apply code formatting * #10: Apply code formatting * #10: Actions and README.md updates * #10: Additional improvements * #10: Update build icon for JDK11
- Loading branch information
1 parent
27a92f0
commit 19a9840
Showing
59 changed files
with
3,360 additions
and
393 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 50 additions & 4 deletions
54
openai-api-http/src/main/java/bg/codexio/ai/openai/api/http/HttpTimeout.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,58 @@ | ||
package bg.codexio.ai.openai.api.http; | ||
|
||
import java.util.Objects; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
/** | ||
* Representation of an HTTP Timeout. | ||
* Can be used for all call, connect and read. | ||
*/ | ||
public record HttpTimeout( | ||
long period, | ||
TimeUnit timeUnit | ||
) {} | ||
public final class HttpTimeout { | ||
private final long period; | ||
private final TimeUnit timeUnit; | ||
|
||
public HttpTimeout( | ||
long period, | ||
TimeUnit timeUnit | ||
) { | ||
this.period = period; | ||
this.timeUnit = timeUnit; | ||
} | ||
|
||
public long period() { | ||
return period; | ||
} | ||
|
||
public TimeUnit timeUnit() { | ||
return timeUnit; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (obj == this) { | ||
return true; | ||
} | ||
if (obj == null || obj.getClass() != this.getClass()) { | ||
return false; | ||
} | ||
var that = (HttpTimeout) obj; | ||
return this.period == that.period && Objects.equals( | ||
this.timeUnit, | ||
that.timeUnit | ||
); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash( | ||
period, | ||
timeUnit | ||
); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "HttpTimeout[" + "period=" + period + ", " + "timeUnit=" | ||
+ timeUnit + ']'; | ||
} | ||
} |
Oops, something went wrong.