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 |
---|---|
boolean |
equals(Object o) |
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
String |
getHost() |
int |
getId()
Returns type identifier for this class.
|
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
UnknownHostException
public 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
UnknownHostException
public InetSocketAddress getInetSocketAddress() throws UnknownHostException
UnknownHostException
public boolean isIPv4()
public boolean isIPv6()
public String getScopeId()
public void setScopeId(String scopeId)
public String getScopedHost()
public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- 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
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.