All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.kubernetes.meta.v1.outputs.LabelSelector Maven / Gradle / Ivy

There is a newer version: 4.19.0-alpha.1730750641
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.kubernetes.meta.v1.outputs;

import com.pulumi.core.annotations.CustomType;
import com.pulumi.kubernetes.meta.v1.outputs.LabelSelectorRequirement;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import javax.annotation.Nullable;

@CustomType
public final class LabelSelector {
    /**
     * @return matchExpressions is a list of label selector requirements. The requirements are ANDed.
     * 
     */
    private @Nullable List matchExpressions;
    /**
     * @return 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.
     * 
     */
    private @Nullable Map matchLabels;

    private LabelSelector() {}
    /**
     * @return matchExpressions is a list of label selector requirements. The requirements are ANDed.
     * 
     */
    public List matchExpressions() {
        return this.matchExpressions == null ? List.of() : this.matchExpressions;
    }
    /**
     * @return 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.
     * 
     */
    public Map matchLabels() {
        return this.matchLabels == null ? Map.of() : this.matchLabels;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static Builder builder(LabelSelector defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable List matchExpressions;
        private @Nullable Map matchLabels;
        public Builder() {}
        public Builder(LabelSelector defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.matchExpressions = defaults.matchExpressions;
    	      this.matchLabels = defaults.matchLabels;
        }

        @CustomType.Setter
        public Builder matchExpressions(@Nullable List matchExpressions) {

            this.matchExpressions = matchExpressions;
            return this;
        }
        public Builder matchExpressions(LabelSelectorRequirement... matchExpressions) {
            return matchExpressions(List.of(matchExpressions));
        }
        @CustomType.Setter
        public Builder matchLabels(@Nullable Map matchLabels) {

            this.matchLabels = matchLabels;
            return this;
        }
        public LabelSelector build() {
            final var _resultValue = new LabelSelector();
            _resultValue.matchExpressions = matchExpressions;
            _resultValue.matchLabels = matchLabels;
            return _resultValue;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy