Closed anthais closed 1 year ago
My code:
IPAddressString ipAddressString = new IPAddressString("1111111"); System.out.println(ipAddressString.getAddress()); // output: 0.16.244.71
I know this can be the int format of IPv4
int
IPv4
IPAddressString ipAddressString = new IPAddressString("1111111"); System.out.println(ipAddressString.getAddress().toIPv4().intValue()); // output: 1111111
I want IPAddressString only accept IPv4, IPv6 or CIDR. How can I do it?
see https://github.com/seancfoley/IPAddress/issues/94 or https://seancfoley.github.io/IPAddress/ipaddress.html#address-or-host-name-validation-options
My code:
I know this can be the
int
format ofIPv4
I want IPAddressString only accept IPv4, IPv6 or CIDR. How can I do it?