Package org.cdk8s.plus24.k8s
Class LabelSelector.Builder
- java.lang.Object
-
- org.cdk8s.plus24.k8s.LabelSelector.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<LabelSelector>
- Enclosing interface:
- LabelSelector
@Stability(Stable) public static final class LabelSelector.Builder extends Object implements software.amazon.jsii.Builder<LabelSelector>
A builder forLabelSelector
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LabelSelector
build()
Builds the configured instance.LabelSelector.Builder
matchExpressions(List<? extends LabelSelectorRequirement> matchExpressions)
Sets the value ofLabelSelector.getMatchExpressions()
LabelSelector.Builder
matchLabels(Map<String,String> matchLabels)
Sets the value ofLabelSelector.getMatchLabels()
-
-
-
Method Detail
-
matchExpressions
@Stability(Stable) public LabelSelector.Builder matchExpressions(List<? extends LabelSelectorRequirement> matchExpressions)
Sets the value ofLabelSelector.getMatchExpressions()
- Parameters:
matchExpressions
- matchExpressions is a list of label selector requirements. The requirements are ANDed.- Returns:
this
-
matchLabels
@Stability(Stable) public LabelSelector.Builder matchLabels(Map<String,String> matchLabels)
Sets the value ofLabelSelector.getMatchLabels()
- Parameters:
matchLabels
- matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.- Returns:
this
-
build
@Stability(Stable) public LabelSelector build()
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<LabelSelector>
- Returns:
- a new instance of
LabelSelector
- Throws:
NullPointerException
- if any required attribute was not provided
-
-