public final class Address extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Address.Type
Address type.
|
| Constructor and Description |
|---|
Address(String host,
int port,
InetAddress address) |
| Modifier and Type | Method and Description |
|---|---|
InetAddress |
address()
Returns the IP address.
|
boolean |
equals(Object obj) |
static Address |
from(int port)
Returns an address for the local host and the given port.
|
static Address |
from(String address)
Returns the address from the given host:port string.
|
static Address |
from(String host,
int port)
Returns an address for the given host/port.
|
int |
hashCode() |
String |
host()
Returns the host name.
|
static Address |
local()
Returns an address that binds to all interfaces.
|
int |
port()
Returns the port.
|
String |
toString() |
Address.Type |
type()
Returns the address type.
|
public Address(String host, int port, InetAddress address)
public static Address local()
public static Address from(String address)
address - the address stringpublic static Address from(String host, int port)
host - the host nameport - the portpublic static Address from(int port)
port - the portpublic String host()
public int port()
public InetAddress address()
public Address.Type type()
Copyright © 2013–2018. All rights reserved.