public final class Address extends Object
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
ADDRESS_FORMAT |
static Address |
NULL_ADDRESS |
| Modifier and Type | Method and Description |
|---|---|
static Address |
create(String host,
int port)
Create address from host and port.
|
boolean |
equals(Object other) |
static Address |
from(String hostandport)
Parses given host:port string to create Address instance.
|
static InetAddress |
getLocalIpAddress()
Getting local IP address by the address of local host.
|
int |
hashCode() |
String |
host()
Returns host.
|
int |
port()
Returns port.
|
String |
toString() |
public static final Address NULL_ADDRESS
public static final Pattern ADDRESS_FORMAT
public static Address from(String hostandport)
hostandport - must come in form host:portpublic static Address create(String host, int port)
host - hostport - portpublic static InetAddress getLocalIpAddress()
RuntimeException - wrapped UnknownHostExceptionpublic String host()
public int port()
Copyright © 2015–2021. All rights reserved.