Package org.cdk8s.plus23.k8s
Class NetworkPolicyPeer.Builder
- java.lang.Object
-
- org.cdk8s.plus23.k8s.NetworkPolicyPeer.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<NetworkPolicyPeer>
- Enclosing interface:
- NetworkPolicyPeer
@Stability(Stable) public static final class NetworkPolicyPeer.Builder extends Object implements software.amazon.jsii.Builder<NetworkPolicyPeer>
A builder forNetworkPolicyPeer
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NetworkPolicyPeer
build()
Builds the configured instance.NetworkPolicyPeer.Builder
ipBlock(IpBlock ipBlock)
Sets the value ofNetworkPolicyPeer.getIpBlock()
NetworkPolicyPeer.Builder
namespaceSelector(LabelSelector namespaceSelector)
Sets the value ofNetworkPolicyPeer.getNamespaceSelector()
NetworkPolicyPeer.Builder
podSelector(LabelSelector podSelector)
Sets the value ofNetworkPolicyPeer.getPodSelector()
-
-
-
Method Detail
-
ipBlock
@Stability(Stable) public NetworkPolicyPeer.Builder ipBlock(IpBlock ipBlock)
Sets the value ofNetworkPolicyPeer.getIpBlock()
- Parameters:
ipBlock
- IPBlock defines policy on a particular IPBlock. If this field is set then neither of the other fields can be.- Returns:
this
-
namespaceSelector
@Stability(Stable) public NetworkPolicyPeer.Builder namespaceSelector(LabelSelector namespaceSelector)
Sets the value ofNetworkPolicyPeer.getNamespaceSelector()
- Parameters:
namespaceSelector
- Selects Namespaces using cluster-scoped labels. This field follows standard label selector semantics; if present but empty, it selects all namespaces.If PodSelector is also set, then the NetworkPolicyPeer as a whole selects the Pods matching PodSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects all Pods in the Namespaces selected by NamespaceSelector.
- Returns:
this
-
podSelector
@Stability(Stable) public NetworkPolicyPeer.Builder podSelector(LabelSelector podSelector)
Sets the value ofNetworkPolicyPeer.getPodSelector()
- Parameters:
podSelector
- This is a label selector which selects Pods. This field follows standard label selector semantics; if present but empty, it selects all pods.If NamespaceSelector is also set, then the NetworkPolicyPeer as a whole selects the Pods matching PodSelector in the Namespaces selected by NamespaceSelector. Otherwise it selects the Pods matching PodSelector in the policy's own Namespace.
- Returns:
this
-
build
@Stability(Stable) public NetworkPolicyPeer build()
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<NetworkPolicyPeer>
- Returns:
- a new instance of
NetworkPolicyPeer
- Throws:
NullPointerException
- if any required attribute was not provided
-
-