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

io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector Maven / Gradle / Ivy

package io.k8s.apimachinery.pkg.apis.meta.v1;

import io.k8s.apimachinery.pkg.apis.meta.v1.labelselector.MatchLabels;
import java.util.List;

/**
 * A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.
 */
public class LabelSelector {
  public List matchExpressions;

  public MatchLabels matchLabels;

  /**
   * matchExpressions is a list of label selector requirements. The requirements are ANDed.
   */
  public LabelSelector matchExpressions(List matchExpressions) {
    this.matchExpressions = matchExpressions;
    return this;
  }

  /**
   * 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 LabelSelector matchLabels(MatchLabels matchLabels) {
    this.matchLabels = matchLabels;
    return this;
  }

  public static LabelSelector labelSelector() {
    return new LabelSelector();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy