Package com.exasol.exasoltestsetup
Class ServiceAddress
- java.lang.Object
-
- com.exasol.exasoltestsetup.ServiceAddress
-
public class ServiceAddress extends Object
This class represents a TCP service address with hostname and port.
-
-
Constructor Summary
Constructors Constructor Description ServiceAddress(String hostName, int port)Create a newServiceAddress.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetHostName()Get the host name.intgetPort()Get the port.inthashCode()booleanisLocal()Get if this is a local address.static ServiceAddresslocal(int port)Create aServiceAddressfor a local service.static ServiceAddressparse(String address)Get aServiceAddressfrom string in format host:ip.StringtoString()
-
-
-
Constructor Detail
-
ServiceAddress
public ServiceAddress(String hostName, int port)
Create a newServiceAddress.- Parameters:
hostName- host nameport- port
-
-
Method Detail
-
local
public static ServiceAddress local(int port)
Create aServiceAddressfor a local service.- Parameters:
port- port number- Returns:
- service address
-
parse
public static ServiceAddress parse(String address)
Get aServiceAddressfrom string in format host:ip.- Parameters:
address- address string in format host:ip- Returns:
- built address
- Throws:
IllegalArgumentException- if the address has an invalid format
-
getHostName
public String getHostName()
Get the host name.- Returns:
- host name
-
getPort
public int getPort()
Get the port.- Returns:
- port
-
isLocal
public boolean isLocal()
Get if this is a local address. (host = localhost)- Returns:
trueif it's a local address
-
-