|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.github.dockerjava.api.model.Ports.Binding
public static class Ports.Binding
A Ports.Binding
represents a socket on the Docker host that is
used in a PortBinding
.
It is characterized by an IP address
and a
port number
.
Both properties may be null
in order to let Docker assign
them dynamically/using defaults.
Ports.bind(ExposedPort, Binding)
,
ExposedPort
Constructor Summary | |
---|---|
Ports.Binding()
Creates a Ports.Binding with both IP address and
port number undefined. |
|
Ports.Binding(Integer hostPort)
Creates a Ports.Binding for the given port number ,
leaving the IP address undefined. |
|
Ports.Binding(String hostIp)
Creates a Ports.Binding for the given IP address ,
leaving the port number undefined. |
|
Ports.Binding(String hostIp,
Integer hostPort)
Creates a Ports.Binding for the given IP address
and port number . |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
String |
getHostIp()
|
Integer |
getHostPort()
|
static Ports.Binding |
parse(String serialized)
Parses a textual host and port specification (as used by the Docker CLI) to a Ports.Binding . |
String |
toString()
Returns a string representation of this Ports.Binding suitable
for inclusion in a JSON message. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Ports.Binding(String hostIp, Integer hostPort)
Ports.Binding
for the given IP address
and port number
.
Ports.bind(ExposedPort, Binding)
,
ExposedPort
public Ports.Binding(Integer hostPort)
Ports.Binding
for the given port number
,
leaving the IP address
undefined.
Ports.bind(ExposedPort, Binding)
,
ExposedPort
public Ports.Binding(String hostIp)
Ports.Binding
for the given IP address
,
leaving the port number
undefined.
public Ports.Binding()
Ports.Binding
with both IP address
and
port number
undefined.
Method Detail |
---|
public String getHostIp()
null
, in which case Docker will bind the
port to all interfaces (0.0.0.0
).public Integer getHostPort()
null
, in which case Docker will dynamically
assign a port.public static Ports.Binding parse(String serialized) throws IllegalArgumentException
Ports.Binding
.
Legal syntax: IP|IP:port|port
serialized
- serialized the specification, e.g.
127.0.0.1:80
Ports.Binding
matching the specification
IllegalArgumentException
- if the specification cannot be parsedpublic String toString()
Ports.Binding
suitable
for inclusion in a JSON message.
The format is [IP:]Port
, like the argument in parse(String)
.
toString
in class Object
Ports.Binding
public boolean equals(Object obj)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |