public class IpAddress extends Object implements PhysicalAddress, Constructable<IpAddress>
Modifier and Type | Field and Description |
---|---|
protected InetAddress |
ip_addr |
protected int |
port |
IP_ADDR, IP_ADDR_UUID, NULL, SITE_MASTER, SITE_UUID, UUID_ADDR
Constructor and Description |
---|
IpAddress() |
IpAddress(InetAddress i,
int p) |
IpAddress(InetSocketAddress sock_addr) |
IpAddress(int port) |
IpAddress(int port,
boolean set_default_host) |
IpAddress(String addr_port)
e.g.
|
IpAddress(String i,
int p) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Address o)
implements the java.lang.Comparable interface
|
IpAddress |
copy() |
Supplier<? extends IpAddress> |
create()
Creates an instance of the class implementing this interface
|
boolean |
equals(Object obj) |
InetAddress |
getIpAddress() |
int |
getPort() |
int |
hashCode() |
String |
printIpAddress() |
void |
readFrom(DataInput in)
Read the state of the current object (including superclasses) from instream
Note that the input stream must not be closed
|
int |
serializedSize()
Returns the size (in bytes) of the marshalled object
|
protected void |
setAddressToLocalHost() |
String |
toString() |
void |
writeTo(DataOutput out)
Write the entire state of the current object (including superclasses) to outstream.
|
protected InetAddress ip_addr
protected int port
public IpAddress()
public IpAddress(String addr_port) throws Exception
Exception
public IpAddress(String i, int p) throws UnknownHostException
UnknownHostException
public IpAddress(InetAddress i, int p)
public IpAddress(int port)
public IpAddress(int port, boolean set_default_host)
public IpAddress(InetSocketAddress sock_addr)
public Supplier<? extends IpAddress> create()
Constructable
create
in interface Constructable<IpAddress>
protected void setAddressToLocalHost()
public InetAddress getIpAddress()
public int getPort()
public int compareTo(Address o)
compareTo
in interface Comparable<Address>
o
- - the Object to be comparedClassCastException
- - if the specified object's type prevents it
from being compared to this Object.Comparable
public String printIpAddress()
printIpAddress
in interface PhysicalAddress
public void writeTo(DataOutput out) throws Exception
Streamable
writeTo
in interface Streamable
Exception
public void readFrom(DataInput in) throws Exception
Streamable
readFrom
in interface Streamable
Exception
public int serializedSize()
SizeStreamable
serializedSize
in interface SizeStreamable
public IpAddress copy()
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.