Skip to content

Commit 48cb18f

Browse files
authored
Merge pull request #426 from yazan-abu-obaideh/425-v6
Fix incorrect httpPort assignment and other issues in `src/main/java/io/weaviate/client6/v1/api/Config.java`
2 parents d25ba00 + 6fdf992 commit 48cb18f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/io/weaviate/client6/v1/api/Config.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static Config of(Function<Custom, ObjectBuilder<Config>> fn) {
2323
return fn.apply(new Custom()).build();
2424
}
2525

26-
public Config(Builder<?> builder) {
26+
private Config(Builder<?> builder) {
2727
this(
2828
builder.scheme,
2929
builder.httpHost,
@@ -42,7 +42,7 @@ public GrpcChannelOptions grpcTransportOptions() {
4242
return new GrpcChannelOptions(scheme, grpcHost, grpcPort, headers, tokenProvider);
4343
}
4444

45-
abstract static class Builder<SELF extends Builder<SELF>> implements ObjectBuilder<Config> {
45+
private abstract static class Builder<SELF extends Builder<SELF>> implements ObjectBuilder<Config> {
4646
protected String scheme;
4747

4848
protected String httpHost;
@@ -158,8 +158,8 @@ public static class Custom extends Builder<Custom> {
158158
* <strong>443</strong> for HTTPS connection and <strong>80</strong> for HTTP.
159159
*/
160160
public Custom scheme(String scheme) {
161-
httpPort(scheme == "https" ? 443 : 80);
162-
grpcPort(scheme == "https" ? 443 : 80);
161+
httpPort("https".equals(scheme) ? 443 : 80);
162+
grpcPort("https".equals(scheme) ? 443 : 80);
163163
return super.scheme(scheme);
164164
}
165165

@@ -169,7 +169,7 @@ public Custom httpHost(String httpHost) {
169169
}
170170

171171
public Custom httpPort(int port) {
172-
this.grpcPort = port;
172+
this.httpPort = port;
173173
return this;
174174
}
175175

0 commit comments

Comments
 (0)