Package com.wireguard.config
Class InetAddresses
- java.lang.Object
-
- com.wireguard.config.InetAddresses
-
public final class InetAddresses extends java.lang.Object
Utility methods for creating instances ofInetAddress
.
-
-
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.
-
-
-
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
orInet6Address
, as appropriate - Throws:
ParseException
-
-