From: David ‘Bombe’ Roden Date: Thu, 11 Apr 2013 06:19:18 +0000 (+0200) Subject: Add methods to configure multiple ports with one method call. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=a125bb14b3c30da259d49433b011c000e64f3c0c;p=xudocci.git Add methods to configure multiple ports with one method call. --- diff --git a/src/main/java/net/pterodactylus/xdcc/data/Network.java b/src/main/java/net/pterodactylus/xdcc/data/Network.java index 2b13478..d78e71c 100644 --- a/src/main/java/net/pterodactylus/xdcc/data/Network.java +++ b/src/main/java/net/pterodactylus/xdcc/data/Network.java @@ -214,6 +214,20 @@ public class Network { } /** + * Adds the given port numbers to the list of unencrypted port numbers. + * + * @param ports + * The port numbers to add + * @return This server builder + */ + public ServerBuilder ports(int... ports) { + for (int port : ports) { + unencryptedPorts.add(port); + } + return this; + } + + /** * Adds the given port number to the list of encrypted port numbers. * * @param sslPort @@ -226,6 +240,20 @@ public class Network { } /** + * Adds the given port numbers to the list of encrypted port numbers. + * + * @param sslPorts + * The port numbers to add + * @return This server builder + */ + public ServerBuilder sslPorts(int... sslPorts) { + for (int sslPort : sslPorts) { + encryptedPorts.add(sslPort); + } + return this; + } + + /** * Builds the server, adds it to the parent network builder and returns the * network builder. *