Class V1LabelSelector

java.lang.Object
io.kubernetes.client.openapi.models.V1LabelSelector

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2024-02-02T17:56:12.287571Z[Etc/UTC]") public class V1LabelSelector extends Object
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.
  • Field Details

  • Constructor Details

    • V1LabelSelector

      public V1LabelSelector()
  • Method Details

    • matchExpressions

      public V1LabelSelector matchExpressions(List<V1LabelSelectorRequirement> matchExpressions)
    • addMatchExpressionsItem

      public V1LabelSelector addMatchExpressionsItem(V1LabelSelectorRequirement matchExpressionsItem)
    • getMatchExpressions

      @Nullable public List<V1LabelSelectorRequirement> getMatchExpressions()
      matchExpressions is a list of label selector requirements. The requirements are ANDed.
      Returns:
      matchExpressions
    • setMatchExpressions

      public void setMatchExpressions(List<V1LabelSelectorRequirement> matchExpressions)
    • matchLabels

      public V1LabelSelector matchLabels(Map<String,String> matchLabels)
    • putMatchLabelsItem

      public V1LabelSelector putMatchLabelsItem(String key, String matchLabelsItem)
    • getMatchLabels

      @Nullable public Map<String,String> getMatchLabels()
      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:
      matchLabels
    • setMatchLabels

      public void setMatchLabels(Map<String,String> matchLabels)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validateJsonObject

      public static void validateJsonObject(com.google.gson.JsonObject jsonObj) throws IOException
      Validates the JSON Object and throws an exception if issues found
      Parameters:
      jsonObj - JSON Object
      Throws:
      IOException - if the JSON Object is invalid with respect to V1LabelSelector
    • fromJson

      public static V1LabelSelector fromJson(String jsonString) throws IOException
      Create an instance of V1LabelSelector given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of V1LabelSelector
      Throws:
      IOException - if the JSON string is invalid with respect to V1LabelSelector
    • toJson

      public String toJson()
      Convert an instance of V1LabelSelector to an JSON string
      Returns:
      JSON string