Remove IpV4Subnet.main()
- Should run as a test case
This commit is contained in:
parent
54047c69cf
commit
f428853b35
@ -225,7 +225,7 @@ public class IpV4Subnet implements IpSet, Comparable<IpV4Subnet> {
|
||||
IpV4Subnet ipV4Subnet = (IpV4Subnet) o;
|
||||
return ipV4Subnet.subnet == subnet && ipV4Subnet.cidrMask == cidrMask;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return subnet;
|
||||
@ -247,24 +247,4 @@ public class IpV4Subnet implements IpSet, Comparable<IpV4Subnet> {
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple test functions
|
||||
*
|
||||
* @param args where args[0] is the netmask (standard or CIDR notation) and optional args[1] is
|
||||
* the inetAddress to test with this IpV4Subnet
|
||||
*/
|
||||
public static void main(String[] args) throws Exception {
|
||||
if (args.length != 0) {
|
||||
IpV4Subnet ipV4Subnet = null;
|
||||
try {
|
||||
ipV4Subnet = new IpV4Subnet(args[0]);
|
||||
} catch (UnknownHostException e) {
|
||||
return;
|
||||
}
|
||||
if (args.length > 1) {
|
||||
System.out.println("Is IN: " + args[1] + " " + ipV4Subnet.contains(args[1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user