@Test public void testIPAddressValidity() { assertFalse(NetUtils.isIPAddressValid(null)); assertFalse(NetUtils.isIPAddressValid("abc")); assertFalse(NetUtils.isIPAddressValid("1.1.1")); assertFalse(NetUtils.isIPAddressValid("1.1.1.1/49")); assertTrue(NetUtils.isIPAddressValid("1.1.1.1")); assertTrue(NetUtils.isIPAddressValid("1.1.1.1/32")); assertTrue(NetUtils.isIPAddressValid("2001:420:281:1004:407a:57f4:4d15:c355")); }
public static boolean isIPAddressValid(String cidr) { return NetUtils.isIPv4AddressValid(cidr) || NetUtils.isIPv6AddressValid(cidr); }
NetUtils { public static boolean isIPAddressValid(String cidr) { return NetUtils.isIPv4AddressValid(cidr) || NetUtils.isIPv6AddressValid(cidr); } }
NetUtils { public static boolean isIPAddressValid(String cidr) { return NetUtils.isIPv4AddressValid(cidr) || NetUtils.isIPv6AddressValid(cidr); } private  NetUtils(); }
NetUtils { public static boolean isIPAddressValid(String cidr) { return NetUtils.isIPv4AddressValid(cidr) || NetUtils.isIPv6AddressValid(cidr); } private  NetUtils(); static int byteArray4ToInt(byte[] ba); static long byteArray6ToLong(byte[] ba); static byte[] longToByteArray6(long addr); static byte[] intToByteArray4(int value); static InetAddress getInetAddress(int address); static InetAddress getInetNetworkMask(int prefixMaskLength, boolean isV6); static int getSubnetMaskLength(byte[] subnetMask); static int getSubnetMaskLength(InetAddress subnetMask); static InetAddress getSubnetPrefix(InetAddress ip, int maskLen); static boolean inetAddressConflict(InetAddress testAddress, InetAddress filterAddress, InetAddress testMask,
            InetAddress filterMask); static boolean isZeroMAC(byte[] mac); static boolean isBroadcastMACAddr(byte[] macAddress); static boolean isUnicastMACAddr(byte[] macAddress); static boolean isMulticastMACAddr(byte[] macAddress); static boolean isAny(InetAddress ip); static boolean fieldsConflict(int field1, int field2); static InetAddress parseInetAddress(String addressString); static boolean isIPv4AddressValid(String cidr); static boolean isIPv6AddressValid(String cidr); static boolean isIPAddressValid(String cidr); static int getUnsignedByte(byte value); static int getUnsignedShort(short value); static InetAddress gethighestIP(boolean v6); static byte[] getBroadcastMACAddr(); }
NetUtils { public static boolean isIPAddressValid(String cidr) { return NetUtils.isIPv4AddressValid(cidr) || NetUtils.isIPv6AddressValid(cidr); } private  NetUtils(); static int byteArray4ToInt(byte[] ba); static long byteArray6ToLong(byte[] ba); static byte[] longToByteArray6(long addr); static byte[] intToByteArray4(int value); static InetAddress getInetAddress(int address); static InetAddress getInetNetworkMask(int prefixMaskLength, boolean isV6); static int getSubnetMaskLength(byte[] subnetMask); static int getSubnetMaskLength(InetAddress subnetMask); static InetAddress getSubnetPrefix(InetAddress ip, int maskLen); static boolean inetAddressConflict(InetAddress testAddress, InetAddress filterAddress, InetAddress testMask,
            InetAddress filterMask); static boolean isZeroMAC(byte[] mac); static boolean isBroadcastMACAddr(byte[] macAddress); static boolean isUnicastMACAddr(byte[] macAddress); static boolean isMulticastMACAddr(byte[] macAddress); static boolean isAny(InetAddress ip); static boolean fieldsConflict(int field1, int field2); static InetAddress parseInetAddress(String addressString); static boolean isIPv4AddressValid(String cidr); static boolean isIPv6AddressValid(String cidr); static boolean isIPAddressValid(String cidr); static int getUnsignedByte(byte value); static int getUnsignedShort(short value); static InetAddress gethighestIP(boolean v6); static byte[] getBroadcastMACAddr(); static final int NUM_BITS_IN_A_BYTE; static final int MAC_ADDR_LENGTH_IN_BYTES; static final int MAC_ADDR_LENGTH_IN_WORDS; }