public class NetworkAddress extends Object
A convenient wrapper class around network primitives in Java.
Modifier and Type | Field and Description |
---|---|
static boolean |
ALLOW_REVERSE_DNS
Flag which controls the usage of reverse dns
|
static String |
REVERSE_DNS_PROPERTY |
Modifier and Type | Method and Description |
---|---|
String |
address()
Returns the string IP representation for this network address.
|
static NetworkAddress |
create(String input)
Creates a new
NetworkAddress from either a hostname or ip address literal. |
boolean |
equals(Object o) |
int |
hashCode() |
String |
hostname()
Returns the hostname for this network address.
|
static NetworkAddress |
localhost()
Creates a new
NetworkAddress for loopback. |
String |
nameAndAddress()
Prints a safe representation of the hostname (if available) and the IP address.
|
String |
nameOrAddress()
Returns the hostname if available and if not returns the address.
|
String |
toString() |
public static final String REVERSE_DNS_PROPERTY
public static final boolean ALLOW_REVERSE_DNS
Flag which controls the usage of reverse dns
public static NetworkAddress create(String input)
Creates a new NetworkAddress
from either a hostname or ip address literal.
public static NetworkAddress localhost()
Creates a new NetworkAddress
for loopback.
public String hostname()
Returns the hostname for this network address.
public String address()
Returns the string IP representation for this network address.
public String nameOrAddress()
Returns the hostname if available and if not returns the address.
public String nameAndAddress()
Prints a safe representation of the hostname (if available) and the IP address.
Copyright © 2017 Couchbase, Inc.. All rights reserved.