Class InetAddresses


  • public final class InetAddresses
    extends java.lang.Object
    Utility methods for creating instances of InetAddress.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isHostname​(java.lang.CharSequence maybeHostname)
      Determines whether input is a valid DNS hostname.
      static java.net.InetAddress parse​(java.lang.String address)
      Parses a numeric IPv4 or IPv6 address without performing any DNS lookups.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isHostname

        public static boolean isHostname​(java.lang.CharSequence maybeHostname)
        Determines whether input is a valid DNS hostname.
        Parameters:
        maybeHostname - a string that is possibly a DNS hostname
        Returns:
        whether or not maybeHostname is a valid DNS hostname
      • parse

        public static java.net.InetAddress parse​(java.lang.String address)
                                          throws ParseException
        Parses a numeric IPv4 or IPv6 address without performing any DNS lookups.
        Parameters:
        address - a string representing the IP address
        Returns:
        an instance of Inet4Address or Inet6Address, as appropriate
        Throws:
        ParseException