Package org.cdk8s.plus22
Class ContainerPort.Builder
- java.lang.Object
-
- org.cdk8s.plus22.ContainerPort.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<ContainerPort>
- Enclosing interface:
- ContainerPort
@Stability(Stable) public static final class ContainerPort.Builder extends Object implements software.amazon.jsii.Builder<ContainerPort>
A builder forContainerPort
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContainerPortbuild()Builds the configured instance.ContainerPort.BuilderhostIp(String hostIp)Sets the value ofContainerPort.getHostIp()ContainerPort.BuilderhostPort(Number hostPort)Sets the value ofContainerPort.getHostPort()ContainerPort.Buildername(String name)Sets the value ofContainerPort.getName()ContainerPort.Buildernumber(Number number)Sets the value ofContainerPort.getNumber()ContainerPort.Builderprotocol(Protocol protocol)Sets the value ofContainerPort.getProtocol()
-
-
-
Method Detail
-
number
@Stability(Stable) public ContainerPort.Builder number(Number number)
Sets the value ofContainerPort.getNumber()- Parameters:
number- Number of port to expose on the pod's IP address. This parameter is required. This must be a valid port number, 0 < x < 65536.- Returns:
this
-
hostIp
@Stability(Stable) public ContainerPort.Builder hostIp(String hostIp)
Sets the value ofContainerPort.getHostIp()- Parameters:
hostIp- What host IP to bind the external port to.- Returns:
this
-
hostPort
@Stability(Stable) public ContainerPort.Builder hostPort(Number hostPort)
Sets the value ofContainerPort.getHostPort()- Parameters:
hostPort- Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. Most containers do not need this.- Returns:
this
-
name
@Stability(Stable) public ContainerPort.Builder name(String name)
Sets the value ofContainerPort.getName()- Parameters:
name- If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.- Returns:
this
-
protocol
@Stability(Stable) public ContainerPort.Builder protocol(Protocol protocol)
Sets the value ofContainerPort.getProtocol()- Parameters:
protocol- Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP".- Returns:
this
-
build
@Stability(Stable) public ContainerPort build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<ContainerPort>- Returns:
- a new instance of
ContainerPort - Throws:
NullPointerException- if any required attribute was not provided
-
-