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/07/26 10:50:25 UTC

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

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



##########
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:
       Agreed. 
   
   It would have been better to add these variants instead of creating the setter, but that is done now, and it's not possible to make the class final now without breaking the API.




-- 
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