Package org.cdk8s.plus25.k8s
Class NetworkPolicyIngressRule.Builder
- java.lang.Object
-
- org.cdk8s.plus25.k8s.NetworkPolicyIngressRule.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<NetworkPolicyIngressRule>
- Enclosing interface:
- NetworkPolicyIngressRule
@Stability(Stable) public static final class NetworkPolicyIngressRule.Builder extends Object implements software.amazon.jsii.Builder<NetworkPolicyIngressRule>
A builder forNetworkPolicyIngressRule
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NetworkPolicyIngressRulebuild()Builds the configured instance.NetworkPolicyIngressRule.Builderfrom(List<? extends NetworkPolicyPeer> from)Sets the value ofNetworkPolicyIngressRule.getFrom()NetworkPolicyIngressRule.Builderports(List<? extends NetworkPolicyPort> ports)Sets the value ofNetworkPolicyIngressRule.getPorts()
-
-
-
Method Detail
-
from
@Stability(Stable) public NetworkPolicyIngressRule.Builder from(List<? extends NetworkPolicyPeer> from)
Sets the value ofNetworkPolicyIngressRule.getFrom()- Parameters:
from- List of sources which should be able to access the pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all sources (traffic not restricted by source). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the from list.- Returns:
this
-
ports
@Stability(Stable) public NetworkPolicyIngressRule.Builder ports(List<? extends NetworkPolicyPort> ports)
Sets the value ofNetworkPolicyIngressRule.getPorts()- Parameters:
ports- List of ports which should be made accessible on the pods selected for this rule. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list.- Returns:
this
-
build
@Stability(Stable) public NetworkPolicyIngressRule build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<NetworkPolicyIngressRule>- Returns:
- a new instance of
NetworkPolicyIngressRule - Throws:
NullPointerException- if any required attribute was not provided
-
-