Skip to content

Commit 9ebdfc1

Browse files
committed
fix: npe on client new builder
- rename proxy to proxySetting - add required parameters address & port in builder ctor
1 parent 25c4abb commit 9ebdfc1

1 file changed

Lines changed: 4 additions & 21 deletions

File tree

src/main/java/io/apimatic/core/configurations/http/client/CoreProxyConfiguration.java

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ public String getPassword() {
6969
* @return a new {@link Builder} instance
7070
*/
7171
public Builder newBuilder() {
72-
return new Builder()
73-
.address(this.address)
74-
.port(this.port)
72+
return new Builder(this.address, this.port)
7573
.username(this.username)
7674
.password(this.password);
7775
}
@@ -95,29 +93,14 @@ public String toString() {
9593
*/
9694
public static class Builder {
9795

98-
private String address;
99-
private int port;
96+
private final String address;
97+
private final int port;
10098
private String username;
10199
private String password;
102100

103-
/**
104-
* Sets the proxy server address.
105-
* @param address the address to set
106-
* @return the builder instance
107-
*/
108-
public Builder address(String address) {
101+
public Builder(String address, int port) {
109102
this.address = address;
110-
return this;
111-
}
112-
113-
/**
114-
* Sets the proxy server port.
115-
* @param port the port to set
116-
* @return the builder instance
117-
*/
118-
public Builder port(int port) {
119103
this.port = port;
120-
return this;
121104
}
122105

123106
/**

0 commit comments

Comments
 (0)