You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/06/26 22:34:32 UTC

[GitHub] [commons-net] garydgregory commented on a change in pull request #84: adding inclusiveHostCount as constructor parameter of SubnetUtils

garydgregory commented on a change in pull request #84:
URL: https://github.com/apache/commons-net/pull/84#discussion_r659233294



##########
File path: src/main/java/org/apache/commons/net/util/SubnetUtils.java
##########
@@ -331,6 +331,33 @@ public SubnetUtils(final String address, final String mask) {
         this.broadcast = this.network | ~this.netmask;
     }
 
+    /**
+     * Constructor that takes a CIDR-notation string, e.g. "192.168.0.1/16", a dotted decimal mask and and flag to
+     * return value of {@link SubnetInfo#getAddressCount()}
+     * @param cidrNotation A CIDR-notation string, e.g. "192.168.0.1/16"
+     * @param inclusiveHostCount A boolean value e.g. true
+     * @throws IllegalArgumentException if the parameter is invalid,
+     * i.e. does not match n.n.n.n/m where n=1-3 decimal digits, m = 1-2 decimal digits in range 0-32
+     */
+    public SubnetUtils(final String cidrNotation, final boolean inclusiveHostCount) {

Review comment:
       Feels superflous since there is a setter method. We do not want, IMO, to add more contructor variants for this and that setting. So -1 from me. Let's see what others think.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org