Skip to content

Commit

Permalink
check conditions of build() in OpenSergoClient.Builder
Browse files Browse the repository at this point in the history
Signed-off-by: Jiangnan Jia <[email protected]>
  • Loading branch information
jnan806 committed Feb 14, 2023
1 parent bd5f15f commit f683364
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/io/opensergo/OpenSergoClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class OpenSergoClient implements AutoCloseable {
public static class Builder {

private String host;
private int port;
private int port = 10246;
private OpenSergoClientConfig openSergoConfig;

public OpenSergoClient.Builder endpoint(String host, int port) {
Expand All @@ -68,6 +68,7 @@ public OpenSergoClient.Builder openSergoConfig(OpenSergoClientConfig openSergoCo
}

public OpenSergoClient build() {
AssertUtils.notEmpty(this.host, "host cannot be empty, maybe need to invoke endpoint(host, port)");
if (this.openSergoConfig == null) {
this.openSergoConfig = new OpenSergoClientConfig();
}
Expand Down

0 comments on commit f683364

Please sign in to comment.