Class PortMapping

java.lang.Object
io.github.alersrt.pod4j.openapi.model.PortMapping

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2024-11-29T01:29:49.168634544+07:00[Asia/Barnaul]", comments="Generator version: 7.7.0") public class PortMapping extends Object
PortMapping
  • Field Details

  • Constructor Details

    • PortMapping

      public PortMapping()
  • Method Details

    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      Validates the JSON Element and throws an exception if issues found
      Parameters:
      jsonElement - JSON Element
      Throws:
      IOException - if the JSON Element is invalid with respect to PortMapping
    • fromJson

      public static PortMapping fromJson(String jsonString) throws IOException
      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
    • containerPort

      public PortMapping containerPort(Integer containerPort)
    • getContainerPort

      @Nullable public Integer getContainerPort()
      ContainerPort is the port number that will be exposed from the container. Mandatory.
      Returns:
      containerPort
    • setContainerPort

      public void setContainerPort(Integer containerPort)
    • hostIp

      public PortMapping hostIp(String hostIp)
    • getHostIp

      @Nullable public String 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

      public void setHostIp(String hostIp)
    • hostPort

      public PortMapping hostPort(Integer hostPort)
    • getHostPort

      @Nullable public Integer 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

      public void setHostPort(Integer hostPort)
    • protocol

      public PortMapping protocol(String protocol)
    • getProtocol

      @Nullable public String 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

      public void setProtocol(String protocol)
    • range

      public PortMapping range(Integer range)
    • getRange

      @Nullable public Integer 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

      public void setRange(Integer range)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toJson

      public String toJson()
      Convert an instance of PortMapping to an JSON string
      Returns:
      JSON string