public final class Address extends Object implements IdentifiedDataSerializable
| Constructor and Description |
|---|
Address() |
Address(Address address) |
Address(InetAddress inetAddress,
int port) |
Address(InetSocketAddress inetSocketAddress)
Creates a new Address
|
Address(String hostname,
InetAddress inetAddress,
int port) |
Address(String host,
int port) |
| Modifier and Type | Method and Description |
|---|---|
static Address |
createUnresolvedAddress(String host,
int port)
Creates an unresolved address.
|
boolean |
equals(Object o) |
int |
getClassId()
Returns type identifier for this class.
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
String |
getHost() |
InetAddress |
getInetAddress() |
InetSocketAddress |
getInetSocketAddress() |
int |
getPort() |
String |
getScopedHost() |
String |
getScopeId() |
int |
hashCode() |
boolean |
isIPv4() |
boolean |
isIPv6() |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
void |
setScopeId(String scopeId) |
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public Address()
public Address(String host, int port) throws UnknownHostException
UnknownHostExceptionpublic Address(InetAddress inetAddress, int port)
public Address(InetSocketAddress inetSocketAddress)
inetSocketAddress - the InetSocketAddress to useNullPointerException - if inetSocketAddress is nullIllegalArgumentException - if the address can't be resolved.public Address(String hostname, InetAddress inetAddress, int port)
public Address(Address address)
public String getHost()
public int getPort()
public InetAddress getInetAddress() throws UnknownHostException
UnknownHostExceptionpublic InetSocketAddress getInetSocketAddress() throws UnknownHostException
UnknownHostExceptionpublic boolean isIPv4()
public boolean isIPv6()
public String getScopeId()
public void setScopeId(String scopeId)
public String getScopedHost()
public int getFactoryId()
IdentifiedDataSerializablegetFactoryId in interface IdentifiedDataSerializablepublic int getClassId()
IdentifiedDataSerializablegetClassId in interface IdentifiedDataSerializablepublic void writeData(ObjectDataOutput out) throws IOException
DataSerializablewriteData in interface DataSerializableout - outputIOException - if an I/O error occurs. In particular,
an IOException may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializablereadData in interface DataSerializablein - inputIOException - if an I/O error occurs. In particular,
an IOException may be thrown if the
input stream has been closed.@PrivateApi public static Address createUnresolvedAddress(String host, int port)
host - hostname or IPport - portCopyright © 2022 Hazelcast, Inc.. All rights reserved.