Class PortMapping
java.lang.Object
io.github.alersrt.pod4j.openapi.model.PortMapping
- All Implemented Interfaces:
Serializable
@Generated("org.openapitools.codegen.languages.JavaClientCodegen")
public class PortMapping
extends Object
implements Serializable
PortMapping
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncontainerPort(Integer containerPort) booleanstatic PortMappingCreate an instance of PortMapping given an JSON stringContainerPort is the port number that will be exposed from the container.HostIP is the IP that we will bind to on the host.HostPort is the port number that will be forwarded from the host into the container.Protocol is the protocol forward.getRange()Range is the number of ports that will be forwarded, starting at HostPort and ContainerPort and counting up.inthashCode()voidsetContainerPort(Integer containerPort) voidvoidsetHostPort(Integer hostPort) voidsetProtocol(String protocol) voidtoJson()Convert an instance of PortMapping to an JSON stringtoString()static voidvalidateJsonObject(com.google.gson.JsonObject jsonObj) Validates the JSON Object and throws an exception if issues found
-
Field Details
-
SERIALIZED_NAME_CONTAINER_PORT
- See Also:
-
SERIALIZED_NAME_HOST_IP
- See Also:
-
SERIALIZED_NAME_HOST_PORT
- See Also:
-
SERIALIZED_NAME_PROTOCOL
- See Also:
-
SERIALIZED_NAME_RANGE
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
PortMapping
public PortMapping()
-
-
Method Details
-
containerPort
-
getContainerPort
ContainerPort is the port number that will be exposed from the container. Mandatory.- Returns:
- containerPort
-
setContainerPort
-
hostIp
-
getHostIp
HostIP is the IP that we will bind to on the host. If unset, assumed to be 0.0.0.0 (all interfaces).- Returns:
- hostIp
-
setHostIp
-
hostPort
-
getHostPort
HostPort is the port number that will be forwarded from the host into the container. If omitted, a random port on the host (guaranteed to be over 1024) will be assigned.- Returns:
- hostPort
-
setHostPort
-
protocol
-
getProtocol
Protocol is the protocol forward. Must be either \"tcp\", \"udp\", and \"sctp\", or some combination of these separated by commas. If unset, assumed to be TCP.- Returns:
- protocol
-
setProtocol
-
range
-
getRange
Range is the number of ports that will be forwarded, starting at HostPort and ContainerPort and counting up. This is 1-indexed, so 1 is assumed to be a single port (only the Hostport:Containerport mapping will be added), 2 is two ports (both Hostport:Containerport and Hostport+1:Containerport+1), etc. If unset, assumed to be 1 (a single port). Both hostport + range and containerport + range must be less than 65536.- Returns:
- range
-
setRange
-
equals
-
hashCode
public int hashCode() -
toString
-
validateJsonObject
Validates the JSON Object and throws an exception if issues found- Parameters:
jsonObj- JSON Object- Throws:
IOException- if the JSON Object is invalid with respect to PortMapping
-
fromJson
Create an instance of PortMapping given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of PortMapping
- Throws:
IOException- if the JSON string is invalid with respect to PortMapping
-
toJson
Convert an instance of PortMapping to an JSON string- Returns:
- JSON string
-