public class PortMapping extends Object implements Serializable
Port mappings allow containers to access ports on the host container instance to send or receive traffic. Port mappings are specified as part of the container definition.
Constructor and Description |
---|
PortMapping() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Integer |
getContainerPort()
The port number on the container that should be used with the port
mapping.
|
Integer |
getHostPort()
The port number on the host that should be used with the port mapping.
|
int |
hashCode() |
void |
setContainerPort(Integer containerPort)
The port number on the container that should be used with the port
mapping.
|
void |
setHostPort(Integer hostPort)
The port number on the host that should be used with the port mapping.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
PortMapping |
withContainerPort(Integer containerPort)
The port number on the container that should be used with the port
mapping.
|
PortMapping |
withHostPort(Integer hostPort)
The port number on the host that should be used with the port mapping.
|
public Integer getContainerPort()
public void setContainerPort(Integer containerPort)
containerPort
- The port number on the container that should be used with the port
mapping.public PortMapping withContainerPort(Integer containerPort)
Returns a reference to this object so that method calls can be chained together.
containerPort
- The port number on the container that should be used with the port
mapping.public Integer getHostPort()
public void setHostPort(Integer hostPort)
hostPort
- The port number on the host that should be used with the port mapping.public PortMapping withHostPort(Integer hostPort)
Returns a reference to this object so that method calls can be chained together.
hostPort
- The port number on the host that should be used with the port mapping.public String toString()
toString
in class Object
Object.toString()
Copyright © 2015. All rights reserved.