Skip to content

Commit a02ae48

Browse files
committed
[BREAKING] Rename ClientBuilder#server methods
1 parent 16ec248 commit a02ae48

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/main/java/org/kitteh/irc/client/library/ClientBuilder.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -296,27 +296,27 @@ public interface ClientBuilder extends Cloneable {
296296
ClientBuilder messageDelay(int delay);
297297

298298
/**
299-
* Sets the server port to which the client will connect.
299+
* Sets the server host to which the client will connect.
300300
* <p>
301-
* By default, the port is 6667.
301+
* By default, the host is localhost.
302302
*
303-
* @param port IRC server port
303+
* @param host IRC server host
304304
* @return this builder
305+
* @throws IllegalArgumentException for null host
305306
*/
306307
@Nonnull
307-
ClientBuilder server(int port);
308+
ClientBuilder serverHost(@Nonnull String host);
308309

309310
/**
310-
* Sets the server host to which the client will connect.
311+
* Sets the server port to which the client will connect.
311312
* <p>
312-
* By default, the host is localhost.
313+
* By default, the port is 6667.
313314
*
314-
* @param host IRC server host
315+
* @param port IRC server port
315316
* @return this builder
316-
* @throws IllegalArgumentException for null host
317317
*/
318318
@Nonnull
319-
ClientBuilder server(@Nonnull String host);
319+
ClientBuilder serverPort(int port);
320320

321321
/**
322322
* Sets the user the client connects as.

src/main/java/org/kitteh/irc/client/library/implementation/IRCClientBuilder.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,16 @@ public IRCClientBuilder messageDelay(int delay) {
249249

250250
@Nonnull
251251
@Override
252-
public IRCClientBuilder server(int port) {
253-
this.serverPort = this.validPort(port);
252+
public IRCClientBuilder serverHost(@Nonnull String host) {
253+
Sanity.nullCheck(host, "Host cannot be null");
254+
this.serverHost = host;
254255
return this;
255256
}
256257

257258
@Nonnull
258259
@Override
259-
public IRCClientBuilder server(@Nonnull String host) {
260-
Sanity.nullCheck(host, "Host cannot be null");
261-
this.serverHost = host;
260+
public IRCClientBuilder serverPort(int port) {
261+
this.serverPort = this.validPort(port);
262262
return this;
263263
}
264264

0 commit comments

Comments
 (0)