/** * Constructor that takes a CIDR-notation string, e.g. "192.168.0.1/16" * @param cidrNotation A CIDR-notation string, e.g. "192.168.0.1/16" * @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-3 decimal digits in range 1-32 */ public SubnetUtils(String cidrNotation) { calculate(cidrNotation); }
/** * Constructor that takes a CIDR-notation string, e.g. "192.168.0.1/16" * @param cidrNotation A CIDR-notation string, e.g. "192.168.0.1/16" * @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-3 decimal digits in range 1-32 */ public SubnetUtils(String cidrNotation) { calculate(cidrNotation); }
/** * Constructor that takes a dotted decimal address and a dotted decimal mask. * @param address An IP address, e.g. "192.168.0.1" * @param mask A dotted decimal netmask e.g. "255.255.0.0" * @throws IllegalArgumentException if the address or mask is invalid, * i.e. does not match n.n.n.n where n=1-3 decimal digits and the mask is not all zeros */ public SubnetUtils(String address, String mask) { calculate(toCidrNotation(address, mask)); }
/** * Constructor that takes a dotted decimal address and a dotted decimal mask. * @param address An IP address, e.g. "192.168.0.1" * @param mask A dotted decimal netmask e.g. "255.255.0.0" * @throws IllegalArgumentException if the address or mask is invalid, * i.e. does not match n.n.n.n where n=1-3 decimal digits and the mask is not all zeros */ public SubnetUtils(String address, String mask) { calculate(toCidrNotation(address, mask)); }