Package org.mockserver.model
Class SocketAddress
- java.lang.Object
-
- org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
-
- org.mockserver.model.ObjectWithJsonToString
-
- org.mockserver.model.SocketAddress
-
public class SocketAddress extends ObjectWithJsonToString
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SocketAddress.Scheme
-
Constructor Summary
Constructors Constructor Description SocketAddress()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getHost()
Integer
getPort()
SocketAddress.Scheme
getScheme()
static SocketAddress
socketAddress()
Static builder to create a socketAddress.SocketAddress
withHost(String host)
The host or ip address to use when connecting to the socket to i.e.SocketAddress
withPort(Integer port)
The port to use when connecting to the socket i.e.SocketAddress
withScheme(SocketAddress.Scheme scheme)
The scheme to use when connecting to the socket, either HTTP or HTTPS.-
Methods inherited from class org.mockserver.model.ObjectWithJsonToString
toString
-
Methods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
equals, fieldsExcludedFromEqualsAndHashCode, hashCode, key
-
-
-
-
Method Detail
-
socketAddress
public static SocketAddress socketAddress()
Static builder to create a socketAddress.
-
getHost
public String getHost()
-
withHost
public SocketAddress withHost(String host)
The host or ip address to use when connecting to the socket to i.e. "www.mock-server.com"- Parameters:
host
- a hostname or ip address as a string
-
getPort
public Integer getPort()
-
withPort
public SocketAddress withPort(Integer port)
The port to use when connecting to the socket i.e. 80. If not specified the port defaults to 80.- Parameters:
port
- a port as an integer
-
getScheme
public SocketAddress.Scheme getScheme()
-
withScheme
public SocketAddress withScheme(SocketAddress.Scheme scheme)
The scheme to use when connecting to the socket, either HTTP or HTTPS. If not specified the scheme defaults to HTTP.- Parameters:
scheme
- the scheme as a SocketAddress.Scheme value
-
-