From a125bb14b3c30da259d49433b011c000e64f3c0c Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 11 Apr 2013 08:19:18 +0200 Subject: [PATCH] Add methods to configure multiple ports with one method call. --- .../java/net/pterodactylus/xdcc/data/Network.java | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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. * -- 2.7.4