public enum DnsResolvers extends Enum<DnsResolvers> implements DnsResolver
Enum Constant and Description |
---|
JVM_DEFAULT
Java VM default resolver.
|
Modifier and Type | Method and Description |
---|---|
InetAddress[] |
resolve(String host)
Returns the IP address for the specified host name.
|
static DnsResolvers |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DnsResolvers[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DnsResolvers JVM_DEFAULT
public static DnsResolvers[] values()
for (DnsResolvers c : DnsResolvers.values()) System.out.println(c);
public static DnsResolvers valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic InetAddress[] resolve(String host) throws UnknownHostException
DnsResolver
resolve
in interface DnsResolver
host
- the hostname, must not be empty or null.adresses
UnknownHostException
- if the given host is not recognized or the associated IP address cannot be used to build an
InetAddress
instanceCopyright © 2016. All rights reserved.