question: private static boolean isIpAddress ( String name ) { if ( IPAddressUtil . isIPv4LiteralAddress ( name ) || IPAddressUtil . isIPv6LiteralAddress ( name ) ) { return true ; } else { return false ; } }
target:  Test whether the given hostname looks like a literal IPv4 or IPv6 address. The hostname does not need to be a fully qualified name. This is not a strict check that performs full input validation. That means if the method returns true, name need not be a correct IP address, rather that it does not represent a valid DNS hostname. Likewise for IP addresses when it returns false.